【发布时间】:2016-06-09 20:18:44
【问题描述】:
我正在制作的网站在超链接中的某些文本旁边有一张图片。
图像带有下划线,文本也带有下划线。我希望图像不带下划线。
a {
-moz-transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
-webkit-transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
-ms-transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
border-bottom: dotted 1px;
color: #0066cc;
text-decoration: none;
}
a:hover {
border-bottom-color: transparent !important;
color: #0066cc !important;
text-decoration: none;
}
img {
outline: none !important;
text-decoration: none !important;
border-bottom-color: transparent !important;
border-bottom: none;
outline-width: 0px;
}
<a href="domain.com"><img src="pic.gif">check this out></a>
没有用。
如果您将鼠标悬停在图像上,下划线会消失,但我希望它永远不会出现。
【问题讨论】:
-
那你为什么写
border-bottom: dotted 1px;? -
我希望它在你没有悬停在它上面时加下划线。