کد زیر رو نوشتم اما position عمل نمیکنه و top رو بالای صفحه در نظر میگیره نه بالای والد!
@font-face {
font-family: vazir;
src: url("fonts/Vazirmatn-Medium.woff2") format(woff2);
}
*{
margin: 0;
padding: 0;
font-family: vazir;
box-sizing: border-box;
}
/* menu */
.menu li a{
text-decoration: none;
color: blue;
}
.menu li{
list-style: none;
display: inline-block;
padding: 10px 20px;
}
.menu li a:hover{
color: aqua;
}
.menu li:hover{
background-color:cadetblue;
border-bottom: 3px dashed wheat;
}
/* .menu li a:visited{
color: black;
} */
/* position */
.parent{
width: 300px;
height: 200px;
background-color: blueviolet;
text-align: center;
padding-top: 80px;
position: relative;
}
.child{
background-color: red;
display: inline;
position: absolute;
top: 0;
}