css - WordPress/CSS : Force a class that inherit from another

标签 css wordpress

我试图强制属于某个类的元素以使其行为不同于其他元素,但是当我尝试更改颜色时,例如,它不起作用(见下图)。我尝试使用“!重要”但没有成功。

元素在“li”中:

<li id="menu-item-178" class="logo-site menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-178"><a title="Home" href="/">Home</a></li>

enter image description here

最佳答案

您需要以更具体的方式定位您的 CSS:

.logo-site a[title="home"] { 
  color: #fff;
}

参见:https://css-tricks.com/attribute-selectors/

关于css - WordPress/CSS : Force a class that inherit from another,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53785422/

相关文章:

html - CSS::元素文本重叠后

css - 我会因为复制网站的样式表而惹上法律麻烦吗?

css - 在多级菜单中隔离 CSS 样式

php - 禁用 WooCommerce 中特定运输区域的 "Place order"按钮

wordpress - 如何在wordpress中显示所有类别?

css 可调整大小的横幅

html - CSS-ReactJS 元素可见时的动画

html - 将 CSS 应用于打印链接

html - 如何在wordpress中建立链接

jquery - 如何在这个 mozilla 页面上实现 html 无缝 div 滚动?