我有一个蓝色下划线,我在删除它时遇到了麻烦。我非常确定它要么是一个边框:无,要么是文本装饰:没有问题,但我似乎找不到解决方案。
以下是我的问题的屏幕截图:

HTML:
<a href="#top"><div class="content_tab" id="first_tab">
<span class="tab_text_centred">Back to top</span>
</div></a>CSS:
.content_tab {
width: 220px;
height: 340px;
margin-right: 0px;
margin-bottom: 20px;
float: left;
background-color: #000;
overflow: hidden;
color: #FFF;
font-family: Georgia, Times ,serif;
font-size: 30px;
font-style: italic;
}
#first_tab {
background-color: #1b1c20;
text-align: center;
}
.tab_text_centred {
position:relative;
top:153px;
}JSFIDDLE:http://jsfiddle.net/craigzilla/DptMf/
发布于 2013-06-07 04:08:18
标记具有默认属性display:inline。DIV标签有默认属性: display:block。标记包装DIV标记与W3C不兼容。对于您的案例,它可以更简单,如下所示:
HTML代码:
<a href="#top" class="content_tab" id="first_tab">
<span class="tab_text_centred">Back to top</span>
</a>CSS代码:
.content_tab {
width: 220px;
height: 340px;
line-height: 340px;
margin-right: 0px;
margin-bottom: 20px;
float: left;
background-color: #000;
overflow: hidden;
color: #FFF;
font-family: Georgia, Times ,serif;
font-size: 30px;
font-style: italic;
}
#first_tab {
background-color: #1b1c20;
text-align: center;
}https://stackoverflow.com/questions/16970994
复制相似问题