I would like to change the size and color of my font on a wordpress menu,however when i use the following code
#access ul{
font-size:25px;
color:red;
}
the size changes but color remains the same, how can i edit my code to get the color working as well
You should be able to change non-current menu items with...
#access li a { color: #000; }
and if the current page is the current menu item change the built-in wordpress class...
.current-menu-item a { color:#FFF; }
(1) Something is overriding on the properties you set here in CSS. (2) Change the color of li instead of ul (3) Provide your ul structure code also
尝试
#access ul{font-size:25px; color:red !important}
Normally, the color property is inherited, but anchor elements does not inherit attributes like color. If you want your <a>
tags to inherit the color use:
#access a { color: inherit; }
try this
#access li a {
color: red;
}
or
a{
color:inherit
}
#access li{
color: red;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.