由于某些原因,背景颜色拒绝从白色改变。我试图让它从白色到黑色的标题下,但它拒绝改变。把"background-color:"放进身体似乎并没有改变它。
我不确定在我的SCSS中是否有什么东西是简单的骑在背景色之上,而我却没有意识到?
任何帮助都是非常感谢的。
SCSS:
*{
margin: 0;
padding: 0;
text-decoration: none;
list-style: none;
background-color: '#010101';
}
#wrapperHeader {
width: 100vw;
height: 210px; /* height of the background image? */
background:url(images/header.png);
}
div#wrapperHeader div#header {
width: 100vw;
height:100px;
margin:0 auto;
}
div#wrapperHeader div#header img {
width: 100vw ; /* the width of the logo image */
height: 210px ; /* the height of the logo image */
margin:0 auto;
}
header {
color: white;
background-color: dimgrey ;
clear: left;
text-align: center;
}
.toggle_menu{
position: fixed;
padding: 17px 20px 15px 15px;
margin-top: 210px;
color: white;
cursor: pointer;
background-color: #000;
z-index: 1000000;
font-size: 2em;
opacity: 0;
}
.sidebar_menu{
position: fixed;
width: 100vh;
max-width: 250px;
margin-left: 0px;
overflow: hidden;
height: 100vh;
max-height: 100vh;
background-color: rgba(17, 17, 17, 0.9);
opacity: 0,9;
transition: all 0.3s ease-in-out;
}
.fa-times{
right: 10px;
top: 10px;
opacity: 0.7;
cursor: pointer;
position: absolute;
color: red;
transition: all 0.3s ease-in-out;
}
.fa-times:hover{
opacity: 1 ;
}
.boxed_item {
font-family: 'Open Sans';
font-weight: 200;
padding: 10px 20px;
display: inline-block;
border: solid 2px white;
box-sizing: border-box;
font-size: 22px;
color: white;
text-align: center;
margin-top: 70px;
}
.logo_bold{
font-weight: 800;
}
.logo_title{
color: white;
font-family: 'Open Sans';
font-weight: 200;
font-size: 12px;
text-align: center;
padding: 5px 0px;
}
.nav_selection{
margin: 0, 0;
display: block;
width: 200;
margin-top: 100px;
margin-left: 5px;
}
.nav_item{
font-weight: 200;
font-family: 'Open Sans';
color: white;
padding: 15px 0;
font-size: 20px;
color: #D8D8D8;
border-bottom: solid 2px #D8D8D8;
transition: all 0.3s ease-in-out;
}
.hide_menu{
margin-left: -250px;
}
.opacity_one{
opacity: 1;
}
.disabled {
pointer-events:none; //This makes it not clickable
opacity:0.6;
font-weight: 200;
font-family: 'Open Sans';
color: white;
padding: 15px 0;
font-size: 20px;
color: #D8D8D8;
border-bottom: solid 2px #D8D8D8;
transition: all 0.3s ease-in-out;
}发布于 2017-12-15 06:58:22
在三个地方,你已经给出三种不同风格的背景颜色代码。请遵循任何格式。
*{ background-color: '#010101'; }中给了它,记住这一点。应该是*{ background-color: #010101; }。background-color: dimgrey ;,所以每次颜色名称不起作用时,您都会给出颜色代码。这是标题部分,您必须对其进行更改。对于dimgrey,颜色代码是:#696969,所以您的代码是:
header {
color: white;
background-color: #696969; // check this line.
clear: left;
text-align: center;
}它将使标题部分的背景色发生变化。你只需要检查那部分。
!important放在代码中,如下所示:header {
color: white;
background-color: #696969 !important; // check this line.
clear: left;
text-align: center;
}如果对你有帮助的话请告诉我。
发布于 2017-12-15 07:37:31
改变背景颜色:'#010101';这个改为背景色:‘#010101!重要’;
https://stackoverflow.com/questions/47827145
复制相似问题