admin管理员组文章数量:1130349
I am trying to change the text color of my current menu item as on hover its green but the background is green so I want the color to be white on hover but it does not seem to want to work, to view hover over the selected page on 'our products'
website link
li.current-menu-item a:hover{
color:white !important;
}
I am trying to change the text color of my current menu item as on hover its green but the background is green so I want the color to be white on hover but it does not seem to want to work, to view hover over the selected page on 'our products'
website link
li.current-menu-item a:hover{
color:white !important;
}
Share
Improve this question
asked Oct 30, 2018 at 10:07
Jenova1628Jenova1628
332 silver badges9 bronze badges
2 Answers
Reset to default 0I just checked your website and found some helpful CSS for your site.
Find this line of CSS and change your color code, it will surely work.
For menu hover and focus ('Use this CSS in bedcentregrimsby.css')
.navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover {
color: #a4cb9a;
}
Please feel free to quote. Thanks, Cheers..!!
In general it's not a good practice to style with !important attribute in CSS. You should try to avoid it.
You will need to find with your browser inspector which CSS rules exist to color your link on hover.
You can find information about how CSS rules overwrite them selves and what rule get's specified in the end: https://developer.mozilla/en-US/docs/Web/CSS/Specificity
E.g.: You already have a hover state style for the link which could override your white color style:
.navbar-nav a:hover, .dropdown-menu>li>a:hover {
color: #a4cb9a !important;
}
in http://beta2018.bedcentregrimsby.co.uk/wp-content/themes/BedCentre2/css/bedcentregrimsby.css?ver=4.9.8 at line 1006
I am trying to change the text color of my current menu item as on hover its green but the background is green so I want the color to be white on hover but it does not seem to want to work, to view hover over the selected page on 'our products'
website link
li.current-menu-item a:hover{
color:white !important;
}
I am trying to change the text color of my current menu item as on hover its green but the background is green so I want the color to be white on hover but it does not seem to want to work, to view hover over the selected page on 'our products'
website link
li.current-menu-item a:hover{
color:white !important;
}
Share
Improve this question
asked Oct 30, 2018 at 10:07
Jenova1628Jenova1628
332 silver badges9 bronze badges
2 Answers
Reset to default 0I just checked your website and found some helpful CSS for your site.
Find this line of CSS and change your color code, it will surely work.
For menu hover and focus ('Use this CSS in bedcentregrimsby.css')
.navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover {
color: #a4cb9a;
}
Please feel free to quote. Thanks, Cheers..!!
In general it's not a good practice to style with !important attribute in CSS. You should try to avoid it.
You will need to find with your browser inspector which CSS rules exist to color your link on hover.
You can find information about how CSS rules overwrite them selves and what rule get's specified in the end: https://developer.mozilla/en-US/docs/Web/CSS/Specificity
E.g.: You already have a hover state style for the link which could override your white color style:
.navbar-nav a:hover, .dropdown-menu>li>a:hover {
color: #a4cb9a !important;
}
in http://beta2018.bedcentregrimsby.co.uk/wp-content/themes/BedCentre2/css/bedcentregrimsby.css?ver=4.9.8 at line 1006
本文标签: csscurrent menu item hover not working
版权声明:本文标题:css - current menu item hover not working? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749220923a2334938.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论