In this section, we will discuss positions.
The static position is the position that is static along the page.
<!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/style.css">
<title>Test</title>
</head>
<body>
<div class="test">
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, nihil!</p>
</body>
</html>
* {
margin: 0;
box-sizing: border-box;
}
.test{
width: 400px;
height: 400px;
background-color: red;
position: static;
}

Notice that the element is static along the page.
Now let’s try the position absolute.
<!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/style.css">
<title>Test</title>
</head>
<body>
<div class="test">
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, nihil!</p>
</body>
</html>
* {
margin: 0;
box-sizing: border-box;
}
.test{
width: 400px;
height: 400px;
background-color: red;
position: absolute;
}

Notice that the box floated on the page.
<!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/style.css">
<title>Test</title>
</head>
<body>
<div class="main">
<div class="test">
</div>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, nihil!</p>
</body>
</html>
* {
margin: 0;
box-sizing: border-box;
}
.main{
width: 400px;
height: 400px;
background-color: aqua;
position: relative;
}
.main .test{
width: 200px;
height: 200px;
background-color: green;
position: absolute;
right: 0;
}