I am new to css.
I have made 2 div’s. Both contain some text.
The first div is a box that will vary in width. I want the second box to always be 50px to the right of the first box, no matter what the width of the first box is.
How can I do this with css?
(I currently have the left box set as absolute positioning)
HTML:
CSS:
This solution only works if the width of the right DIV is fixed. In that case, set the
rightproperty to- ( width + 50 ) px. In my example, it’s -150px.Live demo: http://jsfiddle.net/simevidas/U47Ch/