我试图在我的主动导航中创建白色打击。它适用于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
答案 0 :(得分:1)
这适用于Chrome:
.active a{
text-decoration-color: inherit;
text-decoration: line-through;
}
.active {
color:#fff;
}
<强> jsFiddle example 强>
答案 1 :(得分:0)
答案 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>