我如何让悬停背景颜色填充链接的高度? [英] How do I make the hover background color fill the height of the link?

查看:116
本文介绍了我如何让悬停背景颜色填充链接的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让悬停 background-color 填充导航栏的整个高度加上文本的填充,而不仅仅是文本。

b
$ b

我想让它看起来像这样。





小提琴



我错过了什么?如果你想填充填充和文本颜色,请尝试如下所示:

b
$ b

  a:hover {
background-color:yellow;
颜色:红色;
}


How do I make the hover background-color fill the entire height of the navigation bar plus the padding of the text instead of only the text.

I want to make it look like this.

Fiddle

What am I missing? Thank you in advance!

解决方案

If you wish to colour both the padding and the text try something like:

a:hover{
background-color:yellow;
color:red;
}

这篇关于我如何让悬停背景颜色填充链接的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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