【问题标题】:bootstrap submit button showing blue color even after btn class added即使在添加 btn 类后,引导提交按钮仍显示蓝色
【发布时间】:2012-12-05 23:31:54
【问题描述】:

我在我的 rails 项目中使用引导程序,并且在输入字段和提交按钮上使用 input-append css 类。一切都很好,除了当我将鼠标悬停在提交按钮上时,样式变成蓝色。看起来它忽略了我为其设置的默认灰色类 .btn 并默认为提交按钮具有的蓝色。

<div class="input-append">
       <%= text_field_tag :password, "", :class => 'span2' %>
       <%= button_tag "Submit", :class => 'btn'%>
</div>

这是这段代码输出到 html 的内容。

<div class="input-append">
       <input type="text" value="" name="password" id="password" class="span2">
       <button type="submit" name="button" class="btn">Submit</button>
    </div>

其他人有这个问题。同样,它仅处于悬停状态。

【问题讨论】:

  • 显示你的 css,这样我们就可以在工作时使用一些东西:.btn{background-color:#dddddd;} 例如
  • 我的 css 只是引导 css 文件。

标签: html css ruby-on-rails-3 twitter-bootstrap


【解决方案1】:

我建议您查看 CSS 以找到影响您的按钮的悬停伪选择器,然后将其删除或覆盖它。

【讨论】:

  • 我在 firebug 中查看过它,它显示为 #33333,它不是蓝色。这很奇怪。
  • @Chapsterj Firebug 可能会显示没有选择器的元素的属性。尝试在文件底部添加一行新的 CSS,显示 button.btn:hover {background:#333}
猜你喜欢
  • 2017-10-17
  • 1970-01-01
  • 2014-06-13
  • 2023-04-01
  • 1970-01-01
  • 2023-03-10
  • 1970-01-01
  • 2015-05-10
  • 2021-01-01
相关资源
最近更新 更多