Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

wordpress - cant change font color to white in css navbar

i am trying to make the color of my .blou class with a white color this is my nav i gave them a class in my wordpress but the colorseems to not change this is from the wordpress theme

 .nav-menu ul li a {
    color: #222;
    padding: 10px 15px;
    font-size: 15px;
    display: block;
    font-weight: 600;
}
.nav-menu ul li a:hover {
   background-color: #000F3A;
    color:white;
 
}

then i added this `

.nav-menu ul li.blou1 {
   background-color: #000F3A;
    color:white!important;
 
}`

for some reason the background does change but not the text color to white please help someone

My Menu Contains

Home|Gallery|Contact|About|Members|Login(.blou1 class)|Register(.blou1 class)

also when i hover over the class blou1 it should remove the background and change the text to black or something

question from:https://stackoverflow.com/questions/65864621/cant-change-font-color-to-white-in-css-navbar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

try adding this code snippet instead the snippet you have added, it should work:

.blou1 {
    background-color: #000F3A;
    color:white!important;
}

.blou1:hover {
    color:black;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...