首页 > 解决方案 > 我无法更改块的颜色

问题描述

Сan't change background-color for intro block.

在介绍类的属性中,我应用了 background-color 属性:# 31344e 但该属性不适用。我怎么解决这个问题?

@media all {

}
body {font-family: "Raleway", sans-serif;
font-size: 14px;
	color: #6c7279;
margin: 0;
	background-color: #000000;
-webkit-font-smoothing: antialiased;
}

*,
*:before,
*:after{box-sizing: border-box;}

h1,h2,h3,h4,h5,h6 {margin:0;}

p {margin: 0 0 10px 0;}


/* Container
================*/
.container {
	width: 100%;
	max-width: 1170px;
	margin: 0 auto;
}




/* Header */

.header{position:relative;
	top: 0;
	left:0;
z-index: 1000;
width: 100%;
height: 100px;}

.header_inner {display: flex;
	justify-content: space-between;
	border-bottom: 1px solid #515369;
	padding: 35px 0px;
	align-items: center;
}

/* Navigation */

.nav{font-size: 13px;
font-weight: 700;
text-transform: uppercase;
display: flex;
}

.nav_link {color: #fff;
	text-decoration: none;
	opacity: 0.75;

transition: opacity .2s linear;
margin-left: 50px;}

.nav_link:first-child {margin-left: 0;}

.nav_link:hover {opacity: 1;}

}

/* Intro
========================*/

.intro{height: 750px;
	width: 1900px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background-color: #31344e;

}

.intro_tittle {font-family: 'Open Sans', sans-serif;
font-size: 65px;
color: #ffffff;
font-weight: 700;
margin: 0;
text-transform: uppercase;
text-align: center;
line-height: 1.1;}

.intro__subtitle {font-size: 22px;
	color: #ffffff;
	line-height: 1.5;
font-weight: 400;
text-align: center;
margin-top: 30px;}

.intro_inner {max-width: 970px;
width: 100px;
margin: 0 auto;}

/* _______button */

.button {

wertical-align: top;
font-size: 13px;
color: #ffffff;
font-weight: 600;
text-transform: uppercase;
display:inline-block;
	text-decoration: none;
	padding: 14px 40px;
	border-radius: 2px;
	margin-top: 60px;

}

.button--red{background-color: #e84545;
	transition: background-color 2s;
}

.button--red:hover {background-color: #ec2323;
}
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>ActiveBox</title>
	<link rel="stylesheet" href="style.css">
	<link href="https://fonts.googleapis.com/css2?family=Cardo:ital@1&family=Open+Sans:wght@700&family=Raleway:wght@400;600;700&display=swap"
		  rel="stylesheet">
</head>
<body>

<!---- Header ---->

<header class="header">
	<div class="container">
		<div class="header_inner">
			<div class="header_logo">
				<img src="img/activebox-logo.png" alt="">
			</div>
			<nav class="nav">
				<a class="nav_link" href="#">Features</a>
				<a class="nav_link" href="#">Works</a>
				<a class="nav_link" href="#">Our Team</a>
				<a class="nav_link" href="#">Testimonials</a>
				<a class="nav_link" href="#">Download</a>
			</nav>
		</div>
	</div>
</header>

<!--- Intro --->

<div class="intro">
	<div class="header_inner">
	<div class="container"><h1 class="intro_tittle">Your Favorite One Page Multi Purpose Template</h1>
	<h2 class="intro__subtitle">
		Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab accusamus asperiores aspernatur atque aut
			autem corporis, delectus deleniti eius eveniet fugit hic magnam necessitatibus perferendis perspiciatis
			possimus quaerat tempora voluptatibus?

		<p><a href="#" class="button button--red">ind Out More</a></p></h2>
	</div>
</div>
</div>

/*______Features_____*/

<div class="container">
	<div class="features"></div>
</div>
</body>
</html>

Сan 不能更改介绍块的背景颜色。在介绍类的属性中,我应用了 background-color 属性:# 31344e 但该属性不适用。我怎么解决这个问题?

标签: cssbackground-color

解决方案


推荐阅读