Static Positioning in CSS

CSSWeb DevelopmentFront End Technology

With static positioning, the elements are not affected by the top, bottom, left, and right properties. For this, use position: static.

Example

Let us now see an example −

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
div.static {
   position: static;
   color: white;
   background-color: orange;
   border: 2px dashed blue;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<p>This is demo text.</p>
<p>This is demo text.</p>
<div class="static">
position: static;
</div>
<p>This is another demo text.</p>
</body>
</html>

Output

raja
Published on 30-Dec-2019 12:18:45
Advertisements