Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I have all li with a hover background, but is there away instead of not:lastchild like not: id1 id4 ? Cause i want some li without that hover effect.
nav ul li.selected, nav ul li:hover, nav ul li:focus{ background-color: #0047B2; }
只需将 ID 写为特定情况即可。
nav ul li#id4 { background-color: none; }
您必须为所有想要具有悬停效果的元素提供一个类,并且只需在 css 文件中指定该类。