【问题标题】:Button loses css styling when clicked and loading单击和加载时,按钮会丢失 css 样式
【发布时间】: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


【解决方案1】:

试试这个:

使用 CSS 的焦点状态

.darkbutton:focus {
 color: #fff !important;
}

【讨论】:

    猜你喜欢
    • 2011-06-13
    • 1970-01-01
    • 2019-08-01
    • 2018-08-27
    • 2019-09-22
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    相关资源
    最近更新 更多