Html 如何更改引导程序的井颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21615913/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I change the bootstrap's well color?
提问by G Jeny Ramirez
Well I've been trying to change bootstrap's well color, but it doesn't work, I've tried setting an image as background (the well's) and it worked, but that's not what I need. This is my HTML code:
好吧,我一直在尝试更改引导程序的井颜色,但它不起作用,我尝试将图像设置为背景(井的)并且它有效,但这不是我需要的。这是我的 HTML 代码:
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
Default.aspx
</title>
<script src="Scripts/jquery-1.11.0.js" type="text/javascript"></script>
<link href="Styles/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="Styles/bootstrap-theme.css" rel="stylesheet" type="text/css" />
<link href="Styles/Default.css" rel="stylesheet" type="text/css" />
<script src="Scripts/bootstrap.js" type="text/javascript"></script>
<script src="Scripts/Default.js" type="text/javascript"></script>
</head>
<body>
<div class="well well-lg"><h1 class="">TIDE File Generation</h1></div>
<div id="mainNavigator">
<ul class="nav nav-tabs">
<li><a href="/TideFileGeneration.aspx">Validate file</a></li>
<li><a href="/ImportCatalogs.aspx">Catalogs</a></li>
<li><a href="/InvoiceHistory.aspx">View History</a></li>
<li><a href="/Reports.aspx">Reports</a></li>
</ul>
</div>
</body>
</html>
And this is my CSS code:
这是我的 CSS 代码:
.well{
background-color: rgb(22, 105, 173);
}
Is in the file Default.css
在文件 Default.css 中
Thank you and regards.
谢谢和问候。
采纳答案by malta
That should work.
那应该工作。
Try and inspect the element in Chrome to determine if some other css is overwriting the background-color. By default .well already contains a background-color - make sure you are replacing this.
尝试检查 Chrome 中的元素,以确定是否有其他 css 覆盖了背景颜色。默认情况下 .well 已经包含背景颜色 - 确保您正在替换它。
回答by Ravi
Bootstrap 3 :
引导程序 3:
Set the background property and not the background-color.
设置背景属性而不是背景颜色。
.well {
background: rgb(22, 105, 173);
}
回答by Ido
You can also use !important in your default CSS to override the well background color:
您还可以在默认 CSS 中使用 !important 来覆盖井的背景颜色:
.well{
background-color: cyan !important;
}
That worked for me.
那对我有用。
回答by Miguel
You can just add a style within the div where you declared your well.
您可以在声明井的 div 中添加样式。
Your code:
您的代码:
<div class="well well-lg"><h1 class=""> TIDE File Generation</h1></div>
Suggested code:
建议代码:
<div class="well well-lg" style="background-color: (color of choice);">
<h1 class=""> TIDE File Generation</h1>
</div>`