在css中为其他浏览器制作白色删除线

时间:2014-10-28 13:30:28

标签: css

我试图在我的主动导航中创建白色打击。它适用于Firefox,但对于其他浏览器,它只显示为黑色。有没有办法让它成为白色。

HTML

<div id="menu">
    <ul class="nav nav-pills menu">
        <li class="nav_item">
            <a href="http://localhost:8888/Quadrature-cms/">HOME</a>
        </li>
        <li class="nav_item">
            <a href="http://localhost:8888/Quadrature-cms/index.php?section=2">ABOUT US</a>
        </li>
        <li class="nav_item">
            <a href="http://localhost:8888/Quadrature-cms/index.php?section=3">PORTFOLIO</a>
        </li>
        <li class="active">
            <a href="http://localhost:8888/Quadrature-cms/index.php?section=4">CONTACT US</a>
        </li>
    </ul>
</div>

CSS

.active {
    color: #fff;
    text-decoration: line-through;
}

这是jsfiddel:JSFIDDLE

3 个答案:

答案 0 :(得分:1)

这适用于Chrome:

.active a{
    text-decoration-color: inherit;
    text-decoration: line-through;
}
.active {
    color:#fff;
}

<强> jsFiddle example

答案 1 :(得分:0)

尝试将此设置为a

.active a{
        color: #fff;
        text-decoration: line-through;
    }

<强> DEMO

答案 2 :(得分:0)

试试这个:

<div id="menu">
        <ul class="nav nav-pills menu">
            <li class="nav_item">
                <a href="http://localhost:8888/Quadrature-cms/" style="color:white;text-decoration:line-through"><span style='color:black;'>HOME</span></a>

            </li>
            <li class="nav_item">
                <a href="http://localhost:8888/Quadrature-cms/index.php?section=2" style="color:white;text-decoration:line-through"><span style='color:black;'>ABOUT US</span></a>
            </li>
            <li class="nav_item">
                <a href="http://localhost:8888/Quadrature-cms/index.php?section=3" style="color:white;text-decoration:line-through"><span style='color:black;'>PORTFOLIO</span></a>
            </li>
            <li class="active">
                <a href="http://localhost:8888/Quadrature-cms/index.php?section=4" style="color:white;text-decoration:line-through"><span style='color:black;'>CONTACT US</span></a>
            </li>
        </ul>
    </div>