reative and absolute
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
margin: 0;
}
.box{
width: 200px;
height: 200px;
background: yellow;
}
.ab{
position: absolute;
top: 10px;
right: 10px;
left: 10px;
bottom: 10px;
}
.box2{
width: 200px;
height: 200px;
background: blue;
}
.re{
width: 200px;
height: 200px;
background: blue;
position: relative;
top: 10px;
/* left: 12px; */
/* right: 23px; */
}
.box3{
width: 200px;
height: 200px;
background: lawngreen;
position: relative;
}
.box3 img{
width: 200px;
height: 200px;
object-fit: cover;
}
.price{
color: white;
background: black;
position: absolute;
right: 0px;
bottom: 0px;
}
</style>
</head>
<body>
<div class="box">
</div>
<div class="box2">
</div>
<div class="box3">
<img src="computer.jpg">
<span class="price">
10000
</span>
</div>
</body>
</html>
Comments
Post a Comment