feck Posted December 18, 2006 Share Posted December 18, 2006 I know of the box model bug in IE, but I have a question thats sort of related.Say for a simple page containing only one <h1> element and another element <h1> to <h6>, or even a paragraph element only containing one line of text.Using the web developer extension or even just drawing a border around these elements, should'nt they touch each other with no gaps?Why for instance if you draw a border around the two elements is there still a gap between the two elements? Link to comment Share on other sites More sharing options...
ste Posted December 18, 2006 Share Posted December 18, 2006 there are default margins and line heights the browsers disply with. you can change them with css though Link to comment Share on other sites More sharing options...
feck Posted December 18, 2006 Author Share Posted December 18, 2006 Thanks Ste,I've used a CSS sheet to get rid of the marginsh1,h4{ margin: 0px;}but the two headers still have gaps between, why? Link to comment Share on other sites More sharing options...
jesh Posted December 18, 2006 Share Posted December 18, 2006 There are no gaps between the h1 and h4 elements when you do it like this (i.e. the borders touch): <html><head><style type="text/css">h1, h4 { border: 1px solid red; margin: 0px; }</style></head><body><h1>TEST</h1><h4>test</h4></body></html> There is, however, some padding around each element that you may be able to adjust using padding or line-height. Link to comment Share on other sites More sharing options...
feck Posted December 18, 2006 Author Share Posted December 18, 2006 Thanks JeshYou guys here are unbelievable, succinct and to the point.Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now