为互联网浏览器设计一个小时 [英] Styling a hr for internet explorer

查看:71
本文介绍了为互联网浏览器设计一个小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,在我的追求,尽可能创建一个网站的图像光,我正在寻找创造两个音调小时的。

Hey, in my quest to create as image light a site as possible, I'm looking to create two tone hr's.

我在现代浏览器中实现了这一点,但想在ie6和7中实现相同的效果。

I've achieved this in modern browsers, but want to achieve the same effect in ie6 and 7.

我使用的当前代码是

hr {
    border-bottom:1px solid #FFFFFF; 
    border-top:1px solid #dcdcdc; 
    clear:both; 
    height:0; 
    border-left:0px; 
    border-right:0px;
}

我试过,没有成功使这项工作在ie6和7而不必专门定位浏览器。有任何想法吗?

I've tried, with no success to make this work in ie6 and 7 without having to target the browsers specifically. Any thoughts?

(这是我目前的项目,我在使用这段代码,并希望使其跨浏览器 - http://www.qwibbledesigns.co.uk/preview/aurelius/

(Heres my current project where I am employing this code, and looking to make it cross browser - http://www.qwibbledesigns.co.uk/preview/aurelius/ )

干杯

Matt

推荐答案

(并用< div> 替换< hr>

div {
    /* no need for border-left/right with the following: */
    border: none;
    border-bottom:1px solid #FFFFFF; 
    border-top:1px solid #dcdcdc; 
    clear:both; 
    height:0; 
    width: 100%;
}

(不要忘记添加一个id或类来防止所有div看起来很奇怪)

(and don't forget to add an id or class to prevent all divs to look odd)

注意:这适用于IE7,IE8和兼容的浏览器。可能需要更多的调整为10岁的IE6,或甚至需要一个图像黑客(如此经常)。

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).

这篇关于为互联网浏览器设计一个小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆