- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Custom shadows</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="shadow-box">
<h3>Block with shadows</h3>
</div>
</body>
</html>
CSS
body {
margin: 0;
padding: 0;
background-color: #f5f5f5;
font-family: "Arial Narrow", "Arial", sans-serif;
}
.shadow-box {
position: relative;
width: 400px;
height: 100px;
margin: 50px auto;
padding: 100px 0;
text-align: center;
background-color: white;
box-shadow: 0 0 3px #cccccc;
}
.shadow-box::before,
.shadow-box::after {
content: "";
position: absolute;
top: 80%;
bottom: 15px;
width: 45%;
max-width: 300px;
background-color: #dddddd;
box-shadow: 0 15px 10px #555555;
}
.shadow-box::before {
left: 10px;
}
.shadow-box::after {
right: 10px;
}
You’ve gone to a different page
Goalscompleted
0
- Rotate the
before
pseudoelement of theshadow-box
block3°
counterclockwise. - Then rotate the
after
pseudoelement clockwise3°
. - Assign both pseudo-elements a
z-index
that is equal to-1
.
Comments