【问题标题】:way to override borders when border-radius not supported不支持边框半径时覆盖边框的方法
【发布时间】:2012-04-08 08:58:19
【问题描述】:

我想知道是否有一种方法可以在不支持边框半径时不显示边框,而不必专门针对某些浏览器/使用现代化工具。 (我有一个背景图像,当不存在渐变支持时显示,其中包括渐变和圆角边框,但当然渐变显示在它周围)。

li.toplevel {
font-size: 17px;
margin: 0px;
padding: 12px 18px;
height: 100px;
background: #eeeeee url('../images/headWig.gif') repeat-x; /* Old browsers */
background: -moz-linear-gradient(top, #eeeeee 0%, #dddddd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* IE10+ */
background: linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* W3C */
border: 1px solid #BBB;
-webkit-border-radius: 8px;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius: 8px;
-moz-border-radius-bottomright: 0;
border-radius: 8px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 8px;

}

【问题讨论】:

    标签: internet-explorer css graceful-degradation


    【解决方案1】:

    最好的解决方案是使用 javaScript 来检测它是否受支持,然后在任何条件下执行任何操作。

    似乎您正在寻找一种非 javascript 方法,(通常)您只需要担心 IE8 及以下版本,为此只需使用条件 CSS。

    <!--[if lte IE 8]>
    CSS to Override borders etc
    <![endif]-->
    

    【讨论】:

      猜你喜欢
      • 2011-07-16
      • 2018-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-27
      • 1970-01-01
      • 2012-06-17
      • 1970-01-01
      相关资源
      最近更新 更多