html - 无法将图像添加到 Bootstrap 按钮上的文本

标签 html css twitter-bootstrap

我正在使用 Bootstrap,有时很难覆盖它。

我想在我的按钮上添加一些图片,靠近文本。所以我添加了背景图像,但它不适用。

这是我的按钮的 CSS:

 .submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background: #628d28;
background-image:url('../images/picture.png') no-repeat;
}

但是 Firebug 说,我的元素有下一个 CSS:

  .submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background-image: none repeat color(98,141,40);

}

为什么我不能添加背景图片?

最佳答案

您定义了错误的背景 属性。像这样写:

.submit .report{
background-color: #628d28;
background-image:url('../images/picture.png');
background-repeat:no-repeat;
}

.submit .report{
    background: #628d28 url('../images/picture.png') no-repeat;
 }

关于html - 无法将图像添加到 Bootstrap 按钮上的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12157716/

相关文章:

html - 在背景上设置 youtube 视频

html - 图像框水平对齐

jquery - Bootstrap 溢出滚动标签

css - 更改字段中的日期选择器 Bootstrap 边距

Javascript Module Pattern 使用 Prototype 创建多个实例

html - 相对调整子div的位置

css - 如何覆盖 .mat-grid-tile css

javascript - 通过隐藏或删除元素来优化移动网络应用程序?

firefox - CSS3 动画只适用于 webkit?

html - 使用 float :left 为元素应用适当的边框