move element to right css code example

Example 1: css right

.right {
  position: fixed; /* the fixed pos makes it work */
  right: /*how much you want to move it right 
    put % or px or rem at end of the amount */;
}

Example 2: how to move anything left in css

<html>
   <head>
   </head>

   <body>
      <div style = "position:relative; left:80px; top:2px; background-color:yellow;">
         This div has relative positioning.
      </div>
   </body>
</html>

Example 3: how to shift div to right

<div style="float:left;">

Example 4: div shift right

<div style="position:absolute; right:10;">Hello world</div>

Tags:

Css Example