Need help with creating a 3-line effect using div and before/after selectors. When applying margin-top in the after selector, the line moves down properly. However, when trying to move the line up using margin-bottom in the before selector, it's not working as expected.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Playground</title>
<style>
body {
height: 100vh;
}
#area {
width: 500px;
height: 5px;
background: #333;
}
#area::after {
content: "";
width: 500px;
height: 5px;
margin-top: 15px;
background: red;
display: block;
}
#area::before {
content: "";
width: 500px;
height: 5px;
margin-bottom: 15px;
background: blue;
display: block;
}
</style>
</head>
<body>
<div id="area">
</div>
</body>
</html>