Definition:
CSS position: static is a default position and always positioned with the flow of your pages.
The top, bottom, left and right properties has no affect in position:static elements.
See an example below of using CSS position:static;
Syntax:
position: static;
Source Code:
<!DOCTYPE html>
<html>
<head>
<style>
.static {
position: static;
padding: 5px;
color: white;
background-color: black;
border: 3px solid red;
}
</style>
</head>
<body>
<h3>CSS position:static positioned with the flow of your pages</h3>
<div class="static">This paragraph has used position:static property</div>
</body>
</html>
Output:
You may be interested in the following topics:
- CSS Position relative
- CSS Position sticky
- CSS Position static
- CSS Position fixed
- CSS Position absolute
- CSS Position (All Properties)