Before and after Pseudo selectors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Before and after Pseudo selectors</title>
<style>
body {
background-color: black;
color: white;
margin: 0px;
padding: 0px;
}
header::before {
background: url('https://source.unsplash.com/1600x900/?technology') no-repeat center center/cover;
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.3;
}
.navigation {
font-size: 20px;
display: flex;
}
li {
list-style: none;
padding: 20px 23px;
}
section {
height: 344px;
margin: 3px 23px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
h1 {
font-size: 4rem;
}
p {
text-align: center;
}
/* section::after{
content: "This is my content"
} */
</style>
</head>
<body>
<header>
<nav class="navbar">
<ul class="navigation">
<li class="item">Home</li>
<li class="item">About</li>
<li class="item">Services</li>
<li class="item">Contact us</li>
</ul>
</nav>
</header>
<section>
<h1>Welcome To Coding World</h1>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ducimus odit eligendi aut, vel sint illo atque
maxime facere dolorem, veritatis amet hic at! A nemo voluptatum aperiam, eum dolorum deleniti
consectetur voluptas alias. Expedita?
</p>
</section>
</body>
</html>
Comments
Post a Comment