Connecting Tech Pros Worldwide Forums | Help | Site Map

Reduce the top distance of <h2>

mikek12004's Avatar
Familiar Sight
 
Join Date: Sep 2008
Location: Athens, Greece
Posts: 188
#1: Jun 24 '09
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?)

drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,571
#2: Jun 24 '09

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