2012-12-18 27 views
0

我在我的rails项目中使用bootstrap,我在输入字段上使用input-append css类并提交按钮。所有的作品都很好,除非我将鼠标悬停在提交按钮上时,样式变为蓝色。看起来像忽略了class .btn,我为它设置了默认的灰色,默认为提交按钮具有的蓝色。bootstrap提交按钮,即使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> 

任何其他人都有此问题。它只是在悬停状态。

+0

显示你的CSS,所以我们可以有一些工作,因为这个作品:'.btn {background-color:#ddddd;}'例如 –

+0

我的CSS只是引导CSS文件。 – Chapsterj

回答

0

我建议你看看CSS来找到影响你的按钮的悬停伪选择器,并摆脱它或覆盖它。

+0

我已经看过它在萤火虫和它显示为#33333这是不是蓝色。这是多么奇怪。 – Chapsterj

+0

@Chapsterj Firebug可能会显示没有选择器的元素的属性。尝试在文件底部添加一行新的CSS,该文本说button.btn:hover {background:#333} – Boric

相关问题