CSS Position static

Please Share On:

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:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial