Hey, in my quest to create as image light a site as possible, I'm looking to create two tone hr's.
I've achieved this in modern browsers, but want to achieve the same effect in ie6 and 7.
The current code I am using is
hr {
border-bottom:1px solid #FFFFFF;
border-top:1px solid #dcdcdc;
clear:both;
height:0;
border-left:0px;
border-right:0px;
}
I've tried, with no success to make this work in ie6 and 7 without having to target the browsers specifically. Any thoughts?
(Heres my current project where I am employing this code, and looking to make it cross browser - http://www.qwibbledesigns.co.uk/preview/aurelius/ )
Cheers
Matt
Try something like the following instead (and replace the
<hr>
with a<div>
)(and don't forget to add an id or class to prevent all divs to look odd)
NOTE: this works on IE7, IE8 and on compliant browsers. Probably needs more tweaking for the 10 year old IE6, or even needs an image-hack (as so often).
Setting height to 2px solved the issue for me.
I think that the easiest way is to use
<div class="hr"></div>
instead. Styling<hr/>
cross-browser is head-breaking, in my experience.I havent seen any good answer for this but though my own work figured out the following code should work for styling a HR to look consistent in firefox, safari, chrome and IE (not sure if it works below IE7).
If you're clients have already plastered the site with < hr > tags you can just style hr as well as the hr class then swap < hr > tags out for in ie6 and ie7.
Use the css posted by Abel:
Then in your js file just put:
obviously jQuery is required for this fix, but it worked well for me.