繁体   English   中英

悬停效果 <ul><li> 带有标题的列表

[英]Hover effect in <ul> <li> list with Headings

我有一个<ul> <li>列表,其中HELP,MISC和POLICIES是没有<a>标记的标题。 其他<li>元素具有font-size:16px (正常大小为14px)的hover效果。

我如何删除标题的hover

小提琴

您可以使用

.footer_ul li.bold1:hover {
    font-size:14px;
    text-decoration:none;
}

删除标题的悬停

更新了jsFiddle文件

或者,您可以使用.footer_ul li a:hover.footer_ul li:hover

.footer_ul li a:hover {
    text-decoration:underline;
    font-size:16px;
}

jsFiddle

I checked you fiddle it was good.

The only change you need to make is you have to add :hover class for a tag and not li tag

`

.footer_ul li a:hover {
    text-decoration:underline;
    font-size:16px;
}


`

使用:not()选择器。 像这样需要一个更改。

.footer_ul li:hover:not(.bold1) {
    text-decoration:underline;
    font-size:16px;
}

工作演示

在“ .footer_ul li:hover”之后添加此CSS

.footer_ul li:hover:first-child {
    text-decoration:none;
    font-size:14px;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM