<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: A HaRd challenge - styling an HR element</title>
	<atom:link href="http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Tue, 06 Jan 2009 11:59:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Adam</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-480824</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-480824</guid>
		<description>Thanks a lot guys, this really helped me out. IE certainly is a PIA but the display:block trick on the HR really seems to work. At least it gives you access to the top and bottom margin styles. :-D

I'm sure this saved me lot's of time!</description>
		<content:encoded><![CDATA[<p>Thanks a lot guys, this really helped me out. <acronym title="Internet Explorer">IE</acronym> certainly is a PIA but the display:block trick on the HR really seems to work. At least it gives you access to the top and bottom margin styles. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p>I&#8217;m sure this saved me lot&#8217;s of time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#60;hr /&#62; Abstand im IE - XHTMLforum</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-340697</link>
		<dc:creator>&#60;hr /&#62; Abstand im IE - XHTMLforum</dc:creator>
		<pubDate>Tue, 15 Jul 2008 23:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-340697</guid>
		<description>[...] A Hard challenge - styling an HR element wurde ?ber dieses Problem ausf?hrlich diskutiert, jedoch noch keine zufriedenstellende L?sung [...]</description>
		<content:encoded><![CDATA[<p>[...] A Hard challenge - styling an HR element wurde ?ber dieses Problem ausf?hrlich diskutiert, jedoch noch keine zufriedenstellende L?sung [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seleckis.lv :: ?????? ?????? ????????? &#187; &#187; ?????????????? ??????????? &#60;hr /&#62;</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-282088</link>
		<dc:creator>Seleckis.lv :: ?????? ?????? ????????? &#187; &#187; ?????????????? ??????????? &#60;hr /&#62;</dc:creator>
		<pubDate>Sat, 24 May 2008 13:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-282088</guid>
		<description>[...] ?? ????? ?????? (??? &#60;hr /&#62; ? ??????????????? ??????, A HaRd challenge - Styling An HR Element) ? ???????????????, ???????, ??? ????? ?????? ???????? [...]</description>
		<content:encoded><![CDATA[<p>[...] ?? ????? ?????? (??? &lt;hr /&gt; ? ??????????????? ??????, A HaRd challenge - Styling An HR Element) ? ???????????????, ???????, ??? ????? ?????? ???????? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; Blog Archive &#187; ???????? ???????? ? ?????????? ???? &#60;hr /&#62; :: RUMAKE ::</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-256913</link>
		<dc:creator>&#187; Blog Archive &#187; ???????? ???????? ? ?????????? ???? &#60;hr /&#62; :: RUMAKE ::</dc:creator>
		<pubDate>Fri, 25 Apr 2008 09:34:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-256913</guid>
		<description>[...] A HaRd challenge - styling an HR element [...]</description>
		<content:encoded><![CDATA[<p>[...] A HaRd challenge - styling an HR element [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janne Korkkula</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-203925</link>
		<dc:creator>Janne Korkkula</dc:creator>
		<pubDate>Wed, 06 Feb 2008 19:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-203925</guid>
		<description>&lt;em&gt;*bangs head on wall*&lt;/em&gt; 
I tried just about everything but wasn't convinced, to me the suggested solutions seem complicated and rely on kludges. Then I got this idea instead, works rather well in FF and IE7 at least... YMMV, naturally.

p.h {
  margin: 0;
  padding: 0;
  border-width: 1px 0 0 0;
  border-style: solid;
  border-color: #999;
} 

&#60;p class="h"&#62;&#60;/p&#62;


As a bonus, text inside the (otherwise empty) paragraph will work nicely and can be styled appropriately - color: #999; font-size: 0.75em; text-align: right; etc...</description>
		<content:encoded><![CDATA[<p><em>*bangs head on wall*</em><br />
I tried just about everything but wasn&#8217;t convinced, to me the suggested solutions seem complicated and rely on kludges. Then I got this idea instead, works rather well in FF and IE7 at least&#8230; YMMV, naturally.</p>
<p>p.h {<br />
  margin: 0;<br />
  padding: 0;<br />
  border-width: 1px 0 0 0;<br />
  border-style: solid;<br />
  border-color: #999;<br />
} </p>
<p>&lt;p class=&#8221;h&#8221;&gt;&lt;/p&gt;</p>
<p>As a bonus, text inside the (otherwise empty) paragraph will work nicely and can be styled appropriately - color: #999; font-size: 0.75em; text-align: right; etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leif Halvard Silli</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157734</link>
		<dc:creator>Leif Halvard Silli</dc:creator>
		<pubDate>Sat, 08 Dec 2007 04:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157734</guid>
		<description>Robert,
I made &lt;a href='http://www.malform.no/html5/hr' title='link to HR-element test page' rel="nofollow"&gt;a test page&lt;/a&gt; on my web site. Have a look. I show you how to get more – and less – rid of the gaps.I think the reason you saw any gap on your own tests must have been because you did not try exactly the styling that Michael had. Because, as long as the height of the &lt;code&gt;HR&lt;/code&gt; is only 1px, &lt;em&gt;and/or&lt;/em&gt; as long as you use the CSS color rule to color the &lt;code&gt;HR&lt;/code&gt;, then you should not see any gap with this method. (The «gap[s]» is really the borders of the «shade» variant of the horisontal ruler, as opposed to the &lt;code&gt;noshade&lt;/code&gt; attribute &#38; variant.)The trouble really only begins when you want to have a background image behind the horisontal ruler. Then, in IE, you can't use the color rule. You can then either  increase the bottom-negative margin to -8px to hide the bottom gap (but not the les noticable top-gap, which you haven't mentioned btw...). Or, you can position the &lt;code&gt;hr&lt;/code&gt; so you can apply the clip rule to it, and then wrap it in a &lt;code&gt;div&lt;/code&gt; with &lt;code&gt;position:relative&lt;/code&gt; – to get completely rid of the gaps. Example is on my page. (But I think you did not want to use any &lt;code&gt;div …)</description>
		<content:encoded><![CDATA[<p>Robert,<br />
I made <a href='http://www.malform.no/html5/hr' title='link to HR-element test page' rel="nofollow">a test page</a> on my web site. Have a look. I show you how to get more – and less – rid of the gaps.I think the reason you saw any gap on your own tests must have been because you did not try exactly the styling that Michael had. Because, as long as the height of the <code>HR</code> is only 1px, <em>and/or</em> as long as you use the <acronym title="Cascading Style Sheets">CSS</acronym> color rule to color the <code>HR</code>, then you should not see any gap with this method. (The «gap[s]» is really the borders of the «shade» variant of the horisontal ruler, as opposed to the <code>noshade</code> attribute &amp; variant.)The trouble really only begins when you want to have a background image behind the horisontal ruler. Then, in <acronym title="Internet Explorer">IE</acronym>, you can&#8217;t use the color rule. You can then either  increase the bottom-negative margin to -8px to hide the bottom gap (but not the les noticable top-gap, which you haven&#8217;t mentioned <acronym title="By The Way">BTW</acronym>&#8230;). Or, you can position the <code>hr</code> so you can apply the clip rule to it, and then wrap it in a <code>div</code> with <code>position:relative</code> – to get completely rid of the gaps. Example is on my page. (But I think you did not want to use any <code>div …)</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157281</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 07 Dec 2007 08:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157281</guid>
		<description>Leif,

I have no proper test case at the moment, but if you add background colors to the &lt;code&gt;hr&lt;/code&gt; elements, you should be able to see the gap.</description>
		<content:encoded><![CDATA[<p>Leif,</p>
<p>I have no proper test case at the moment, but if you add background colors to the <code>hr</code> elements, you should be able to see the gap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leif Halvard Silli</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157166</link>
		<dc:creator>Leif Halvard Silli</dc:creator>
		<pubDate>Fri, 07 Dec 2007 00:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-157166</guid>
		<description>Michael, contrary to &lt;a href='#comment-77719' rel="nofollow"&gt;what Simon said&lt;/a&gt;, I found that &lt;a href='#comment-68383' rel="nofollow"&gt; your solution&lt;/a&gt; actually does work in IE7 as well. So, I'd say you have solved the challenge Robert put forward! Well done, congrats and thank you!
However, what &lt;em&gt;doesn't&lt;/em&gt; work in IE7 is to use &lt;code&gt;margin:0 !important&lt;/code&gt; the way you do. Because, when IE7  is in standards-mode, then that rule will actually «win» over &lt;code&gt;margin:-7px&lt;/code&gt; – like it should. (In quirks-mode that elegant trick still works.) Simply remove &lt;code&gt;!important&lt;/code&gt; and insert the IE-spesifice rule via a real hack – e.g. &lt;code&gt;!margin:-7px;&lt;/code&gt; or conditional comments or what ever. 
Robert, in my tests I don't see &lt;a href='#comment-68550' rel="nofollow"&gt; that 1 pixel gap that you mention&lt;/a&gt;. Hence I wonder if that gap is caused be some other thing. Perhaps you can show us a page where you say the problem is?</description>
		<content:encoded><![CDATA[<p>Michael, contrary to <a href='#comment-77719' rel="nofollow">what Simon said</a>, I found that <a href='#comment-68383' rel="nofollow"> your solution</a> actually does work in IE7 as well. So, I&#8217;d say you have solved the challenge Robert put forward! Well done, congrats and thank you!<br />
However, what <em>doesn&#8217;t</em> work in IE7 is to use <code>margin:0 !important</code> the way you do. Because, when IE7  is in standards-mode, then that rule will actually «win» over <code>margin:-7px</code> – like it should. (In quirks-mode that elegant trick still works.) Simply remove <code>!important</code> and insert the <acronym title="Internet Explorer">IE</acronym>-spesifice rule via a real hack – e.g. <code>!margin:-7px;</code> or conditional comments or what ever.<br />
Robert, in my tests I don&#8217;t see <a href='#comment-68550' rel="nofollow"> that 1 pixel gap that you mention</a>. Hence I wonder if that gap is caused be some other thing. Perhaps you can show us a page where you say the problem is?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sai</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-151279</link>
		<dc:creator>sai</dc:creator>
		<pubDate>Tue, 27 Nov 2007 20:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-151279</guid>
		<description>Hey use consecutive HRs to see the effect they produce in IE and firefox. That's how you are gonna see the difference. I've faced this problem too! I think that wrapping thing works for every kinda webbrowser.</description>
		<content:encoded><![CDATA[<p>Hey use consecutive HRs to see the effect they produce in <acronym title="Internet Explorer">IE</acronym> and firefox. That&#8217;s how you are gonna see the difference. I&#8217;ve faced this problem too! I think that wrapping thing works for every kinda webbrowser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phill Brown</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-147359</link>
		<dc:creator>Phill Brown</dc:creator>
		<pubDate>Thu, 22 Nov 2007 11:41:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-147359</guid>
		<description>Hours of searching for a solution to this problem and this page contains the best results sofar.  I am surprised such a simple seeming thing is so difficult.</description>
		<content:encoded><![CDATA[<p>Hours of searching for a solution to this problem and this page contains the best results sofar.  I am surprised such a simple seeming thing is so difficult.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-77719</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 05 Jul 2007 03:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-77719</guid>
		<description>I can confirm it does not work in IE7.

you get top and bottom margins.

I can also confirm that it does work in ie6/FF, but not working in ie7.

It really sucks because it forces me to use things like
&lt;code&gt;
&#60;div class="line"&#62;&#60;/div&#62;
&lt;/code&gt;
Which is bad semantically, and not to mention if it gets used alot, it is 5 times as many characters as &#60;hr /&#62; or &#60;hr&#62;</description>
		<content:encoded><![CDATA[<p>I can confirm it does not work in IE7.</p>
<p>you get top and bottom margins.</p>
<p>I can also confirm that it does work in ie6/FF, but not working in ie7.</p>
<p>It really sucks because it forces me to use things like<br />
<code><br />
&lt;div class="line"&gt;&lt;/div&gt;<br />
</code><br />
Which is bad semantically, and not to mention if it gets used alot, it is 5 times as many characters as &lt;hr /&gt; or &lt;hr&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-68550</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 11 Jun 2007 20:16:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-68550</guid>
		<description>Michael,

Thanks for your suggestion!
I haven't access to IE 7 right now, but I can confirm that it works fine in Firefox, Safari and (almost) IE 6. In IE 6, I actually get a 1 pixel gap beneath, but I guess this is as close as we can get.</description>
		<content:encoded><![CDATA[<p>Michael,</p>
<p>Thanks for your suggestion!<br />
I haven&#8217;t access to <acronym title="Internet Explorer">IE</acronym> 7 right now, but I can confirm that it works fine in Firefox, Safari and (almost) <acronym title="Internet Explorer">IE</acronym> 6. In <acronym title="Internet Explorer">IE</acronym> 6, I actually get a 1 pixel gap beneath, but I guess this is as close as we can get.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-68383</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 11 Jun 2007 10:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-68383</guid>
		<description>Hi Mark,

I've been struggling with this issue for quite a while now.
The main problem with the 7px top margin can be fixed as stated above:

margin:0px !important; //for non-IE, !important keeps it there
margin:-7px 0; //for IE

However, on this approach we still have to fix the bottom margin.
Your assumtions that HR is handled similar to text are not 100% correct but not incorect either.
I have found out that HR actually is set to inline (as most text is).
Therefore the most obious conclusion is to reset the display to

display:block;

This actually tells IE to stop acting like a bitch and use it as a box. So, final code is:

hr { 
height:1px; 
display:block; 
margin: 0 !important; 
margin: -7px; 
color:#798c7c; 
background-color:#798c7c; 
border:0px;  
}

Works like a charm on FF and IE6 (I don't have IE7 yet so I can't guarantee for it since it depends on how IE7 acts on !important).

Hope this helped (Battle won).

Sincerely,
Michael Potra</description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p>I&#8217;ve been struggling with this issue for quite a while now.<br />
The main problem with the 7px top margin can be fixed as stated above:</p>
<p>margin:0px !important; //for non-<acronym title="Internet Explorer">IE</acronym>, !important keeps it there<br />
margin:-7px 0; //for <acronym title="Internet Explorer">IE</acronym></p>
<p>However, on this approach we still have to fix the bottom margin.<br />
Your assumtions that HR is handled similar to text are not 100% correct but not incorect either.<br />
I have found out that HR actually is set to inline (as most text is).<br />
Therefore the most obious conclusion is to reset the display to</p>
<p>display:block;</p>
<p>This actually tells <acronym title="Internet Explorer">IE</acronym> to stop acting like a bitch and use it as a box. So, final code is:</p>
<p>hr {<br />
height:1px;<br />
display:block;<br />
margin: 0 !important;<br />
margin: -7px;<br />
color:#798c7c;<br />
background-color:#798c7c;<br />
border:0px;<br />
}</p>
<p>Works like a charm on FF and IE6 (I don&#8217;t have IE7 yet so I can&#8217;t guarantee for it since it depends on how IE7 acts on !important).</p>
<p>Hope this helped (Battle won).</p>
<p>Sincerely,<br />
Michael Potra</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43511</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 20 Mar 2007 07:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43511</guid>
		<description>Andreas,

Well, that can be one approach, but that means that you will always need to know the context th &lt;code&gt;hr&lt;/code&gt; element is in, which I'm striving to get away from.

Kiper,

It sucks, doesn't it? :-)</description>
		<content:encoded><![CDATA[<p>Andreas,</p>
<p>Well, that can be one approach, but that means that you will always need to know the context th <code>hr</code> element is in, which I&#8217;m striving to get away from.</p>
<p>Kiper,</p>
<p>It sucks, doesn&#8217;t it? <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kiper</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43504</link>
		<dc:creator>Kiper</dc:creator>
		<pubDate>Tue, 20 Mar 2007 06:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43504</guid>
		<description>OUCH! I think I just got bitten by the IE-bug.

Please, Robert, no more HeadeRache!</description>
		<content:encoded><![CDATA[<p>OUCH! I think I just got bitten by the <acronym title="Internet Explorer">IE</acronym>-bug.</p>
<p>Please, Robert, no more HeadeRache!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43452</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Mon, 19 Mar 2007 23:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-43452</guid>
		<description>I use plenty of hr's to separate the main-parts of my site, but i always display: none on all of them later on, and apply borders to other elements to get the same look.
This way it's both semantically correct, and easy to style cross-browser.

I never use a div.hr or something like that, but rather add borders to existing elements placed directly above or around the hr's.</description>
		<content:encoded><![CDATA[<p>I use plenty of hr&#8217;s to separate the main-parts of my site, but i always display: none on all of them later on, and apply borders to other elements to get the same look.<br />
This way it&#8217;s both semantically correct, and easy to style cross-browser.</p>
<p>I never use a div.hr or something like that, but rather add borders to existing elements placed directly above or around the hr&#8217;s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42464</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 14 Mar 2007 12:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42464</guid>
		<description>Pontus,

On it's own, it doesn't work for me. I think the key phrase in your comment is:

&lt;blockquote cite="http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42435"&gt;
The hr is stuck in between floats.
&lt;/blockquote&gt;

I can imagine that that might work, but what I'm looking for is a standalone solution that isn't context-sensitive whatsoever.</description>
		<content:encoded><![CDATA[<p>Pontus,</p>
<p>On it&#8217;s own, it doesn&#8217;t work for me. I think the key phrase in your comment is:</p>
<blockquote cite="http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42435"><p>
The hr is stuck in between floats.
</p></blockquote>
<p>I can imagine that that might work, but what I&#8217;m looking for is a standalone solution that isn&#8217;t context-sensitive whatsoever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pontus Nilsson</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42435</link>
		<dc:creator>Pontus Nilsson</dc:creator>
		<pubDate>Wed, 14 Mar 2007 10:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42435</guid>
		<description>Hi Robert,

After reading the article the other night I came to the same conclusion as Anton but it seemed so obvious that I was sure I was doing something wrong. However, my site is now pixel perfect for the first time in that particular area. Since I don't consider myself either a guru or expert I'll give you what I think might be good to know.

IE gets html4/strict and the rest get xhtml11 if they want.

The hr is stuck in between floats.

I've checked it in FF1.5 &#38; 2.0, Opera9.1, IE5-7 on XP. No Mac :(

The css looks as follows (which obviously won't work in IE7):
&lt;code&gt;hr	{
 	clear:left;
	margin:0;
 	_margin:-7px 0;
	border:0;
	padding:0;
 	height:0;
 	background:#FFF;
 	color:#FFF;
 	display:block;
}
&lt;/code&gt;
It seems that it is display: block that's pulling things together which is strange since I thought hr was a block level element but we're targeting IE right? I also tried it with width and text-align and it still worked.

It'll be interesting to hear if this works or if it's some weirdness in my code doing the magic.

Cheers</description>
		<content:encoded><![CDATA[<p>Hi Robert,</p>
<p>After reading the article the other night I came to the same conclusion as Anton but it seemed so obvious that I was sure I was doing something wrong. However, my site is now pixel perfect for the first time in that particular area. Since I don&#8217;t consider myself either a guru or expert I&#8217;ll give you what I think might be good to know.</p>
<p><acronym title="Internet Explorer">IE</acronym> gets html4/strict and the rest get xhtml11 if they want.</p>
<p>The hr is stuck in between floats.</p>
<p>I&#8217;ve checked it in FF1.5 &amp; 2.0, Opera9.1, IE5-7 on XP. No Mac <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The <acronym title="Cascading Style Sheets">CSS</acronym> looks as follows (which obviously won&#8217;t work in IE7):<br />
<code>hr	{<br />
 	clear:left;<br />
	margin:0;<br />
 	_margin:-7px 0;<br />
	border:0;<br />
	padding:0;<br />
 	height:0;<br />
 	background:#FFF;<br />
 	color:#FFF;<br />
 	display:block;<br />
}<br />
</code><br />
It seems that it is display: block that&#8217;s pulling things together which is strange since I thought hr was a block level element but we&#8217;re targeting <acronym title="Internet Explorer">IE</acronym> right? I also tried it with width and text-align and it still worked.</p>
<p>It&#8217;ll be interesting to hear if this works or if it&#8217;s some weirdness in my code doing the magic.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42325</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 13 Mar 2007 20:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42325</guid>
		<description>Anton,

Unfortunately, no. It works for the top margin, but not the bottom one (all in IE, of course).</description>
		<content:encoded><![CDATA[<p>Anton,</p>
<p>Unfortunately, no. It works for the top margin, but not the bottom one (all in <acronym title="Internet Explorer">IE</acronym>, of course).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Andreasson</title>
		<link>http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42313</link>
		<dc:creator>Anton Andreasson</dc:creator>
		<pubDate>Tue, 13 Mar 2007 18:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/09/a-hard-challenge-styling-an-hr-element/#comment-42313</guid>
		<description>Last time I used a hr I think I applied something like margin:-7px 0; to it. Could be wrong.</description>
		<content:encoded><![CDATA[<p>Last time I used a hr I think I applied something like margin:-7px 0; to it. Could be wrong.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
