CSS position: relative;

CSSWeb DevelopmentFront End Technology

The position: relative; property allows you to position element relative to its normal position. You can try to run the following code to implement CSS position: relative;

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            position: relative;
            left: 20px;
            border: 3px solid blue;
         }
      </style>
   </head>
   <body>
      <h1>Positioning Element</h1>
      <div>
         div element with position: relative;
      </div>
   </body>
</html>

Output

raja
Published on 08-May-2018 14:24:21
Advertisements