I am making a 3d design with transform skew properties. But when I give height to li::before it shows greater than what is given in vs code. You can see in snippet given height is 98.4px, but it shows height of 135px in box model.
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500&display=swap');
*,*::before,*::after{
margin:0;
padding:0;
box-sizing:border-box;
color:white;
font-family: 'Oswald', sans-serif;
}
a{
text-decoration: none;
}
html, body {
height: 100%;
width: 100%;
}
body{
background-color:#434750;
display:flex;
justify-content: center;
align-items:center;
}
ul{
font-size:1.2rem;
transform: skewY(-15deg);
}
li{
background-color: #3e3f46;
list-style:none;
padding:1em;
position: relative;
}
li::before{
content: "";
position:absolute;
width:50px;
height:98.4px;
background-color:#3e3f46;
filter: brightness(0.7);
top:0;
left: -50px;
display: block;
transform-origin: right;
transform: skewY(45deg);
}
<!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>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul>
<li><a href = "#">Whats App</a></li>
<li><a href = "#">Instagram</a></li>
<li><a href = "#">Facebook</a></li>
<li><a href = "#">Twitter</a></li>
</ul>
</body>
</html>
Box Model
