Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 即使在添加btn类后,引导提交按钮仍显示蓝色_Html_Css_Ruby On Rails 3_Twitter Bootstrap - Fatal编程技术网

Html 即使在添加btn类后,引导提交按钮仍显示蓝色

Html 即使在添加btn类后,引导提交按钮仍显示蓝色,html,css,ruby-on-rails-3,twitter-bootstrap,Html,Css,Ruby On Rails 3,Twitter Bootstrap,我在rails项目中使用bootstrap,并在输入字段和提交按钮上使用InputAppend css类。所有的作品都很棒,除了当我把鼠标悬停在提交按钮上时,样式变成蓝色。看起来它忽略了我为其默认灰色设置的class.btn,并默认为提交按钮的蓝色 <div class="input-append"> <%= text_field_tag :password, "", :class => 'span2' %> <%= button_

我在rails项目中使用bootstrap,并在输入字段和提交按钮上使用InputAppend css类。所有的作品都很棒,除了当我把鼠标悬停在提交按钮上时,样式变成蓝色。看起来它忽略了我为其默认灰色设置的class.btn,并默认为提交按钮的蓝色

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

“span2%”
'btn'>
下面是该代码输出到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,找到影响按钮的悬停伪选择器,然后将其删除或覆盖。

显示您的CSS,这样我们就可以在工作时使用它了:
.btn{background color:#dddddddd;}
例如,我的css只是一个引导css文件。我在firebug中看过它,它显示为#33333,不是蓝色。这太奇怪了。@chapsterjfirebug可能在没有选择器的情况下显示元素的属性。尝试在文件底部添加一行CSS,上面写着button.btn:hover{background:#333}