move div to right 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 shift div to right

<div style="float:left;">

Example 3: div shift right

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

Example 4: how to move a div to the right using a funvtion

window.addEventListener('click', function(e){
  if (document.getElementById("ClickBox").contains(e.target)) {
    var boxxy = document.getElementById("ClickBox");
    boxxy.style.left = (boxxy.offsetLeft + 50) + 'px';
  }
});

Tags:

Css Example