Connecting Tech Pros Worldwide Help | Site Map

Reduce the top distance of <h2>

  #1  
Old June 24th, 2009, 08:31 AM
mikek12004's Avatar
Familiar Sight
 
Join Date: Sep 2008
Location: Athens, Greece
Posts: 181
I use <h2> for my hedings which leaves some default space above and below it, how can I decrease the above space with css? (tried margin-bottom:-5px but didn't work, why?)
  #2  
Old June 24th, 2009, 04:22 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,521

re: Reduce the top distance of <h2>


Quote:
Originally Posted by mikek12004 View Post
I use <h2> for my hedings which leaves some default space above and below it, how can I decrease the above space with css? (tried margin-bottom:-5px but didn't work, why?)
Almost all elements have some margin built into them as a default. To remove that:
Expand|Select|Wrap|Line Numbers
  1. h2{margin:0}
  2.  
Reply