Position your HTML element with CSS

CSSWeb DevelopmentFront End Technology

CSS helps you to position your HTML element. You can put any HTML element at whatever location you like. You can specify whether you want the element positioned relative to its natural position in the page or absolute based on its parent element. 

Example

Let us see an example of relative positioning −

 <html>
    <head>
    </head>
    <body>
       <div style = "position:relative;left:70px;top:1px;background-color:blue;color: white;">
          This div has relative positioning.
       </div>
    </body>
</html>
raja
Published on 18-Apr-2018 06:52:01
Advertisements