Want to move a specific div to the right

Hi, I want to move a particular div more to the right, so that the div on the left will contain more space to display the content in it. Tried a few things in css, but I know that I am doing something wrong.

+16
css
source share
2 answers

You can use float for this particular div, for example

<div style="float:right;"> 

Float the div in which you want more space, as well as the left:

 <div style="float:left;"> 

If all else fails, then the div is in the right position: absolute, and then it moves as correctly as you want it to.

 <div style="position:absolute; left:-500px; top:30px;"> 

etc .. Obviously, the style should be added to a separate stylesheet, but this is just a faster example.

+26
source share

This will do the job:

 <div style="position:absolute; right:0;">Hello world</div> 
0
source share

All Articles