HTML:删除a:悬停图片? [英] HTML: remove a:hover for images?

查看:120
本文介绍了HTML:删除a:悬停图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于文字链接,我有:

CSS:

a:link {color: #3366a9; text-decoration: none}
a:hover {border-bottom: 1px solid; color: black}

但这还会在可链接的 IMGs上添加黑色下划线我不想要。

But this also adds a black underline on linkable IMGs that I do not want.

如果在使用CSS漫游时,如何删除可链接IMG上的 border-bottom

How do I remove the border-bottom on linkable IMGs when hovered using CSS?

我试过下面的:

a:hover img {border-bottom: 0px}

但这不起作用

实例(尝试将鼠标悬停在顶部的标志上)左)

Live example (try to hover over the logo in top-left)

推荐答案

如果你浮动你的图像vs.内联这将工作,将不需要修改图像链接属性史蒂夫的答案

If you float your images vs. inline this will work and will require no modifications to image link attributes that Steve's answer requires.

a:hover img {
border: none !important;
display: block;
}

这篇关于HTML:删除a:悬停图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆