CSS - 文本装饰不适用于图像

标签 css

我的页面中有一张图片,当我将鼠标悬停在该图片上时 text-decoration:underline; css 属性不起作用...

<div class='imgover'>
   click me<img  src='http://www.google.co.uk/images/srpr/logo3w.png' alt='Img' />
</div>

css类如下,

.imgover:hover
{    
    text-decoration:underline;
}

引用此链接 http://jsfiddle.net/smanimani/cwnwK/1/

但是文本装饰对于文本工作正常,但它不适用于图像...!

我该如何解决?

提前致谢....!

最佳答案

使用

.imgover:hover 
{     
border-bottom: 1px solid red; 
} 

关于CSS - 文本装饰不适用于图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12858427/

相关文章:

html - 如何溢出 3 级深度菜单 ul > li > ul > li > ul > li

css - 表格容器内的 flexbox 容器、PRE 标签和管理溢出

css - 什么是用户代理样式表?

ios - 垂直对齐属性在 iPad iOS 8 中不起作用

css - 在 header.php 中将 wordpress 中的菜单文本居中

css - 使用 css 属性更改不透明度级别

javascript - 不需要的突出显示 HTML 元素的选择

javascript - jQuery.animate() 函数上的菜单 "ul"与子菜单 "ul"元素重叠

css - 像 Ionic 2 中的 Modal 一样发出警报

javascript - 仅向单击的元素及其子元素添加类