Isn't IE simply special? Try setting the font-size...for some reason that comes to mind.
hmm, what do I set it to?
If you want to see how it looks, try this:
border:1px solid gray;
<h2>Free Web Building Tutorials</h2>
<div style="margin:1px 0; background:#eee; height:1px;"></div>
<p>At W3Schools you will find all the Web-building tutorials you need,
from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.</p>
<p>W3Schools - The Largest Web Developers Site On The Net!</p></div>
See the line seperator after the line "Free Web Building Tutorials" and if you can look at it in IE 6, you will see how different it looks...
You were right!
<div style="margin:1px 0; background:#eee;font-size: 1px; height:1px;"></div>
That works :) Thanks a lot.
Why not use the html element that's intended to be a separator instead of abusing an empty div ?
Yes you can style them too.
Swa66, vikasvrao's goal is to implement a purely CSS solution to fix the problem. Unnecessary (X)HTML works against SEO, in other words the less code/more content the better! ;)
vikasvrao, I forgot to mention, be sure to implement IE specific fixes in conditional comment style sheets. You don't want to end up looking at that code and removing it only to later see IE rendering as a mess.
I have to agree with swa66 on this one. <hr> is your rule element...and using it as such will IMPROVE both code AND css.
I know and appreciate effort to just use CSS and not being allowed/able to change the (x)html.
But not being able to change the html isn't the case here as the OP is using inline CSS.
I'm by far not a SEO specialist, but if you seek to have a better content/size ratio, it seems "<hr>" is _far_ shorter than "<div style="margin:1px 0; background:#eee;font-size: 1px; height:1px;"></div> " and then style it from a stylesheet. Even using a stylesheet with a "<hr>" is still a serious factor shorter than "<div class="xyz"></div>" ... and it has the semantics of <hr> fully on it's side.
Give it a class, there are exceptionally few if any instances where inline styling is necessary.
|<div style="margin:1px 0; background:#eee; height:1px;"></div> |
I agree that what is being described fits purpose of the <hr />. it's purpose is to 'buffer' content. "The amount of vertical space inserted between a rule and the content that surrounds it..."
Don't see how a <hr /> would impact SEO at all, certainly not worse than a 'junk' <div>.