简体   繁体   English

如何更改 hover 的颜色<li>在实现 css</li>

[英]How to change hover color on a <li> in materialize css

I am using the materialize CSS framework for my website.我正在为我的网站使用物化 CSS 框架。 I have a dropdown on my website as well.我的网站上也有一个下拉菜单。 When you click it and it shows the elements that are part of it, they have the correct background color, but when you hover, it acts like it is white and shades the white.当您单击它并显示作为其中一部分的元素时,它们具有正确的背景颜色,但是当您单击 hover 时,它就像是白色的一样,并且对白色进行阴影处理。 May I please have help to make it correctly shade the black background I have.我可以帮忙使它正确遮蔽我的黑色背景。

<ul id="games" class="dropdown-content" tabindex="0" style="display: block; width: 143.188px; left: 1222.81px; top: 0px; height: 94px; transform-origin: 0px 0px; opacity: 1; transform: scaleX(1) scaleY(1);">
<li tabindex="0" class="brand-black"><a href="#!">We have no games at the moment.</a></li>
</ul>

https://i.imgur.com/bN9mv5P.gif https://i.imgur.com/bN9mv5P.gif

.dropdown-content li:hover, .dropdown-content li.active {
background-color: #A10000 !important;
}

I changed the hover color of my custom dropdown putting that in my styles.css file.我更改了自定义下拉菜单的 hover 颜色,将其放入我的 styles.css 文件中。 Use.important so you ensure that the changes will be applied.使用.important,以便确保应用更改。

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

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