我在这个网站上看到了几个相关的问题,但所有这些问题似乎都是由选择器问题造成的,但我认为这不是问题所在。
就我而言,Google Chrome和Safari都告诉我,a
标签的计算样式为text-decoration:none
。
选择a
代码并设置text-decoration:none
没有任何区别,因为他们已经有text-decoration:none
该页面由几个不同的样式表设置样式,包括一个来自我的博客主题,一个来自namespaced import Materialise框架,最后是一个用户定义的样式表,我留下空(因此我没有在这篇文章中包含CSS)。
演示: http://codepen.io/prashcr/pen/RaBKGY
以下是HTML:
<body class="site animated fade-in-down">
<div class="site-wrap center">
<div class="post p2 p-responsive wrap" role="main">
<div class="measure">
<div class="mcss">
<div class="container">
<div class="row">
<div class="col s12 m7">
<div class="card">
<div class="card-image waves-effect waves-block waves-light">
<img class="activator" src="http://materializecss.com/images/office.jpg">
</div>
<div class="card-content">
<span class="card-title activator grey-text text-darken-4">
Kanban<i class="material-icons right">more_vert</i>
</span>
<p><a href="#!">This is a link</a></p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
<a href="#">This is a link</a>
</div>
<div class="card-reveal">
<span class="card-title grey-text text-darken-4">
Card Title<i class="material-icons right">close</i>
</span>
<p>Here is some more information about this product that is only revealed once clicked on.</p>
</div>
</div>
</div>
<div class="col s12 m5">
<div class="card">
<div class="card-image waves-effect waves-block waves-light">
<img class="activator" src="http://materializecss.com/images/office.jpg">
</div>
<div class="card-content">
<span class="card-title activator grey-text text-darken-4">
Camper News<i class="material-icons right">more_vert</i>
</span>
<p><a href="#!">This is a link</a></p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
<a href="#">This is a link</a>
</div>
<div class="card-reveal">
<span class="card-title grey-text text-darken-4">
Card Title<i class="material-icons right">close</i>
</span>
<p>Here is some more information about this product that is only revealed once clicked on.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
答案 0 :(得分:7)
那里不是文字装饰。这是一张背景图片。 Chrome开发工具显示了这一点:
a {
color: #0076df;
background-image: linear-gradient(to top, transparent 13%, rgba(0, 118, 223, 0.8) 13%, rgba(0, 118, 223, 0.8) 18%, transparent 17%);
text-shadow: white 1px 0px 0px, white -1px 0px 0px;
}
当我在开发工具中禁用background-image
属性时,蓝线会消失。
答案 1 :(得分:3)
好的,这可能会对你有帮助
.mcss a:active, .mcss a:hover {background-image: none;}
.mcss a {color: #039be5;background-image: none;text-decoration: none;}
答案 2 :(得分:0)
将background-image: none;
添加到.mcss a
.mcss a {
color: #039be5;
text-decoration: none;
background-image: none;
}