Jump to content

Boxing elements?


feck

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...