【发布时间】:2016-08-20 03:24:39
【问题描述】:
我似乎无法弄清楚这一点。当我单击按钮并加载目标页面时,按钮会丢失其文本样式。原始按钮样式是从我正在使用的 wordpress 主题中提取的。我已经包含了一个 gif 和代码供参考。有什么想法吗?
实际操作:https://imgflip.com/gif/197tc9
.darkbutton {
color: #fff !important;
border: 2px solid #fff !important;
background-color: #0be2a1 !important;
margin-top: 4px !important;
}
.darkbutton:hover {
color: #0be2a1 !important;
border: 2px solid #fff !important;
background-color: #fff !important;
}
【问题讨论】:
-
向我们展示你的一些代码?
-
向我们展示您的 html 部分
-
停止使用
!important;如果您需要将其添加到每个属性,您需要编写更好的标记。它应该作为最后的手段使用,而不是在 CSS 的每一行中。过度使用!important;可能会导致您遇到的显示问题。 -
如果你不张贴代码,我玛去吧
标签: html css wordpress button styling