I want to move a particular div more to the right side so that the div in the left gets some more space to display the contents in it.
I tried few things in CSS, but I know I am doing something wrong.
In CSS, I have...
login-box { width: 200px; margin-left: 50px; }
You can use float on that particular div, e.g. If all else fails give the div on the right position:absolute and then move it as right as you want it to be.
The best method for positioning #div1 depends on whether you want it to affect the position of the other chid divs. If so, apply float: right; to #div1 . If not, position: absolute; is the way to go; you may want to add padding to the right of #divContainer so that #div1 doesn't sit on top of the other child divs.
If position: absolute; or position: fixed; - the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor. If position: relative; - the right property sets the right edge of an element to a unit to the left/right of its normal position.
You can use float on that particular div, e.g.
<div style="float:right;">
Float the div you want more space to have to the left as well:
<div style="float:left;">
If all else fails give the div on the right position:absolute and then move it as right as you want it to be.
<div style="position:absolute; left:-500px; top:30px;">
etc. Obviously put the style in a seperate stylesheet but this is just a quicker example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With