html - wordpress 不支持当前菜单背景颜色?

标签 html css wordpress

我在 wordpress 中为侧边栏类别编写了背景图像和颜色。

我为类别的子菜单设置了背景图片

.sub-menu li.menu-item-object-category {
    background: url("http://www.example.com/dev/123/wp-content/uploads/2014/04/list_style.png") no-repeat scroll left center transparent;
}

这里我将事件的当前菜单项高亮颜色设置为背景色

.menu-item-object-category.current-menu-item {
    background: none repeat scroll 0% 0% rgb(234, 234, 234);
}

这里不支持同时删除背景图片表示激活背景色,删除背景色表示激活背景色。我想同时激活两者。

帮助解决这个问题。

最佳答案

如果我没理解错的话,您是在用颜色覆盖背景图像,反之亦然。

改为尝试:

.sub-menu li.menu-item-object-category {
    background-image: url("http://www.example.com/dev/123/wp-content/uploads/2014/04/list_style.png") no-repeat scroll left center transparent;
}

.menu-item-object-category.current-menu-item {
    background-color: none repeat scroll 0% 0% rgb(234, 234, 234);
}

关于html - wordpress 不支持当前菜单背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23532686/

相关文章:

php - 更新数据库表行

jquery - div下的mouseover和mouseout函数

javascript - php、mysql 和 javascript

javascript - jQuery动画 anchor

如果字段重复,mysql 会防止重复行

php - 如何解决 PHP ACF 错误 : "Trying to access array offset on value of type bool"?

javascript - 具有不透明度和粒子的 CSS 单击动画

css - font-family 在 Firefox 中不工作,但在所有其他浏览器中工作?

html - 填充增加边框的宽度

javascript - 使用 jQuery 或 JS 增加元素宽度