All,
I have a div in my page that has a set width of 1000px, height of
200px, inside this i declare two more div's, both relatively
positioned and floated left, the first is placed to the top left of
the box and is a 30px square, the other one is set to 970px and is
naturally positioned next to the square and so fills all the way to
the right hand edge of the box.
Now i need the second (wider) box to overlap the square and so start
at the left hand edge of the box - this has been achieved by setting
the left property of the wider box to -30 but obviously this leads to
a gap on the right hand side of 30 pixels, however when i increase the
width of the wider box by the extra 30 pixels required to put it's
right edge all the way to the edge of the containing div (or if i even
make it one pixel wider - 971px) it automatically pushes the box down
to the next line because of the relative positioning.
It seems that the CSS is not taking into account the fact that the box
has been pushed 30 pixels to the left when calculating if there is
enough space to fit the box on the same line as the square.
Has anybody come across anything like this before - is there a
different approach that can be taken to solve the problem without
using the float property? I would like to try to avoid the use of
absolute positioning if possible.
Cheers
Ian