文字装饰不影响超链接
Text Decoration Not Affecting Hyperlink
我有一个部分在我的网站上有一个链接,但它有一个下划线,所以我尝试了text-decoration: none;
,但无济于事。有人能帮我解决这个问题吗?
<div class="content2">
<div class="twitterfeed">
<h3>Twitter Feed</h3>
</div>
<div class="recent">
<h3 class="text3">Recent News<span class="slash"> / </span><span class="text4">Get updates from us!</span></h3>
</div>
<div class="readnews">
<a href="themes.goodlayers2.com/musicclub/blog-full-with-right-sidebar/"> <p class="readall"> Read All News </p></a>
</div>
</div>
<style type="text/css">
.content2 {
background: #191919;
padding-top: 10px;
padding-left: 25px;
padding-right: 20px;
}
.twitterfeed {
float: left;
padding-left: 140px;
color: white;
font-size: 30px;
font-family: Didot, Georgia, sans-serif;
}
.recent {
display: inline-block;
padding-left: 230px;
}
.readnews {
float: right;
color: white;
padding-right: 457px;
text-decoration: none;
}
.text3 {
color: white;
font-family: "Goudy Old Style", Optima, sans-serif;
font-size: 35px;
margin-bottom: 0;
}
.text4 {
font-size: 30px;
color: #6CB9D9;
}
.readall {
text-decoration: none;
color: white;
}
</style>
您有一个div元素,其中包含一个a,其中包含一个p。DIV有一个带有文本装饰的类,但是您需要将它应用于a元素,因此您可以使用.readnews a{ text-deciration:none; }
另一方面,在HTML中,不应该在内联元素(a标记)中添加BLOCK元素(P标记),因此从技术上讲,这是错误的。无论如何,它会工作,但你应用文本装饰:none到P,而你应该把它添加到a…A标签总是比其他元素更"重要"。
如果你想保留你的HTML元素,你应该在p里面添加A,所以:Div> p> a然后给A标签添加样式
<a href="themes.goodlayers2.com/musicclub/blog-full-with-right-sidebar/" class="readall"> <p> Read All News </p></a>
可以保留p元素
给周围的锚标记class readall而不是段落。我还是把p元素去掉吧
相关文章:
- 制作一个不带HTML a标记但在动画播放完毕后指向其他页面的超链接
- 单击超链接时,如何使用Google Maps API v3缩放地图
- 用超链接替换URLS
- 使用JavaScript从超链接加载时的默认下拉值
- Hammer.js阻止在Android Webview中点击超链接
- 将超链接添加到“;标题“;标记文本
- 文本建议的超链接
- 用Javascript按钮替换Javascript超链接
- 删除默认的ui超链接行为
- 谷歌将广告超链接映射到国家标记
- 如何在点击超链接时调用fullcalendar回调
- 单击“禁用其他超链接”
- 为Angularjs制作超链接
- 指向的超链接刚刚赢得'不起作用
- 如何将超链接添加到通过传单创建的传单多段线.Draw
- 如何禁用鼠标中键单击超链接以在新选项卡或新窗口中打开
- 如何在每个动态创建的ImageButton周围包装超链接?Visual Studio
- 将数据库中的超链接添加到查询结果
- 文字装饰不影响超链接
- 阻止超链接的默认操作会影响浏览器历史记录吗?