Removing the
border styling on IE

后端 未结 4 1345
遇见更好的自我
遇见更好的自我 2020-12-28 17:50

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 its side). T

相关标签:
4条回答
  • 2020-12-28 17:57

    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.

    0 讨论(0)
  • 2020-12-28 18:02

    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;
    }
    
    0 讨论(0)
  • 2020-12-28 18:03

    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.

    0 讨论(0)
  • 2020-12-28 18:13

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

    <style type="text/css">
        hr {
           background: url(http://placekitten.com/800/100) no-repeat;
           border: 0;
           height: 100px;
           width: 100%;
        }
    </style>
    <!--[if IE 7]>
    <style type="text/css">
        hr {
            display : list-item;
            list-style : url(http://placekitten.com/800/100) inside;
            filter : alpha(opacity=0);
            margin-left: -10px;
            width : 0;
        }
    </style>
    <![endif]-->
    

    See it working here: jsFiddle

    0 讨论(0)
提交回复
热议问题