WEN Associate主题自定义CSS:修改主菜单选中项高亮条及按钮背景色
解决方案
1. 修改主菜单选中项下方高亮条颜色(改为白色)
WEN Associate主题的菜单选中项高亮条通常通过伪元素实现,用以下CSS覆盖默认橙色:
/* 主菜单当前选中项高亮条改为白色 */ .main-navigation .current-menu-item > a::after, .main-navigation .current_page_item > a::after { background-color: #ffffff !important; }
2. 修改“招聘服务”区块按钮背景色(改为米色#a58263)
你之前的代码存在两个问题:一是类名拼写错误(正确类名是.wp-block-button__link,而非.wp-block-button_link);二是主题默认样式优先级更高,需要更具体的选择器来覆盖。
使用以下代码解决:
/* 招聘服务区块按钮改为米色 */ .wp-block-button .wp-block-button__link { background-color: #a58263 !important; border-color: #a58263 !important; /* 同步修改按钮边框色,保持视觉统一 */ }
如果上述代码仍不生效,可通过浏览器开发者工具(F12)定位按钮元素,找到该区块专属的父容器类名,用更具体的选择器加强优先级,示例如下:
/* 假设招聘服务区块容器类为.recruitment-section */ .recruitment-section .wp-block-button .wp-block-button__link { background-color: #a58263 !important; }
内容的提问来源于stack exchange,提问作者ShawnaQ
相关产品推荐
相关产品推荐

