ABOUT PROBLEM
I tried to make hamburger-menu from YouTube tutorial. In 6.23 minute we had a problem with displaying ::after
and ::before
element - without display: flex
on .hamburger-menu
class we don't see black spaces. In tutorial I heard we have the problem because .hamburger-menu
is inline by default. I don't understand why we can see black elements only when parent class is flex or grid (I check) or when I fill content
property with the text. Even if I set it to block element I don't see the change.
CODE
.hamburger-menu{
display:flex;
}
.hamburger-menu:after,
.hamburger-menu:before,
.hamburger-menu input{
width:60px;
height:7px;
content:"";
background-color:rgb(30,30,30);
border-radius:10000px;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<label class="hamburger-menu">
<input type="checkbox"></label>
</label>
</body>
</html>