i am trying to create 3 lines using a div and before and after selectors. applying margin-top in after is moving the line down but in before margin-bottom is not moving the line up.
<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>