Position Property
by Boyanliuu
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="box position">
</div>
</div>
</body>
</html>
CSS
:root {
box-sizing: border-box;
}
*,
::before,
::after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
body{
height:100vh;
display:flex;
justify-content:center;
align-items:center;
}
.container {
border: 1px solid red;
width: 400px;
height: 400px;
}
.box {
background: lightblue;
width: 100px;
height: 100px;
position:relative;
left:100px;
}