views:

3035

answers:

4

Why is it the simple things that IE manages to mess up the most? Anyway I want to replace a normal hr line with a single image a bit like the - § - symbol (on it's side). Trying to make it look elegant :)

It appears the only way to actually get rid of the border in IE though is to set the color: css value. Doing this will override whatever is set as background-image unfortunately and make the whole hr the parameter for color.

It's not possible to wrap it in a div or even really apply a class to it as the client that will be using the site is using a wysiwyg text editor which I don't really relish hacking to insert a div wrapped hr.

I am one step away from adding a div block wrapper with jquery, but that seems fundamentally wrong (shotgun vs walnut) - any suggestions?

A: 

Well, you could just insert the image directly and not use an <hr /> tag. However, I'm fairly certain you can get rid of the offending border by just changing it to be the color of your background. I mean, it's not actually gone, but at least it's hiding:

hr{
   border: #XXXXXX;
}
Peter
Unfortunately IE does not consider HR borders as 'borders'. If you set border: 1px #f0f solid; it'll add a fuschia border around the existing bevelled border. FF + IE8 behave and actually realise that border: 0; means I don't want a border - IE 7 and less, not so much.
Meep3D
A: 

IE8, fortunately does things properly. So there is hope in 12 years.

If your background color is solid, just define the border as that color and it disappears.

rpflo
Almost, IE snatches defeat from the jaws of victory by placing the border color (if set with color:) on _top_ of the background-image. The mind boggles. And I know, I feel like I'll be coding for IE6 'standards' until I die.
Meep3D
A: 

You could change the color of the border to transparent - I think that'll work, anyway.

Otherwise you should just use the image itself and scrap the <hr /> tag.

Eugene Bulkin
+6  A: 

http://blog.neatlysliced.com/2008/03/hr-image-replacement/

Detect
Utterly ingenious! Whoever came up with that is better at CSS than I am!
Meep3D