सापेक्ष स्थिति के साथ, तत्व अपनी सामान्य स्थिति के सापेक्ष स्थित होता है। इसके लिए स्थिति:सापेक्ष . का उपयोग करें
उदाहरण
आइए अब एक उदाहरण देखें -
<!DOCTYPE html>
<html>
<head>
<style>
div.demo {
position: relative;
color: white;
background-color: orange;
border: 2px dashed blue;
left: 50px;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<p>This is demo text.</p>
<p>This is demo text.</p>
<div class="demo">
position: relative;
</div>
<p>This is another demo text.</p>
</body>
</html> आउटपुट
