html - 使用 Bootstrap 自定义更改按钮上的悬停颜色

标签 html css responsive-design twitter-bootstrap-3

我正在尝试以悬停使按钮颜色更浅而不是颜色更深的方式设置按钮样式。我尝试了 Bootstrap 自定义页面 ( http://getbootstrap.com/customize/ ),但它没有给我更改按钮悬停颜色的选项。我尝试通过检查 CSS 手动执行此操作,但不清楚按钮如何获得悬停颜色。我尝试了另一个 bootstrap 定制网站

http://pikock.github.io/bootstrap-magic/app/#!/editor

我希望主颜色为#0495c9,悬停颜色为#00b3db,但我只能指定按钮背景色,而不能指定悬停颜色。

任何帮助将不胜感激

最佳答案

按钮的颜色来自 btn-x 类(例如 btn-primary、btn-success),因此如果您想通过编写自己的自定义 css 规则手动更改颜色,则需要更改:

/*This is modifying the btn-primary colors but you could create your own .btn-something class as well*/
.btn-primary {
    color: #fff;
    background-color: #0495c9;
    border-color: #357ebd; /*set the color you want here*/
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open>.dropdown-toggle.btn-primary {
    color: #fff;
    background-color: #00b3db;
    border-color: #285e8e; /*set the color you want here*/
}

关于html - 使用 Bootstrap 自定义更改按钮上的悬停颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25923623/

相关文章:

php - 我的php网站的Metro风格动态磁贴

css - 创建 Bootstrap 响应式布局时如何设置容器 div 的宽度?

javascript - jQuery在textarea中显示html排除元素

html - 创建下拉菜单,子菜单出现在鼠标悬停时

css - 如何使用 CSS 在悬停时添加不同的 CSS3 悬停过渡

javascript - 如何在 Leaflet.js 中添加多个标记?

html - 在响应式方形 div 中垂直居中图像

css - 使用 Flexbox 作为媒体查询的替代方案

html - 属性的 <label> 是否必须是唯一的?

html - thymeleaf <img> 里面 <div th :text>