I want the set of divs to fit sideways, for example:
D0
---------------------------------------
| ------ ------ ------ ------ |
| | | | | | | | | |
| | D1 | | D2 | | D3 | | D4 | |
| | | | | | | | | |
| ------ ------ ------ ------ |
---------------------------------------
It is centered inside D1. I can do this by setting D0 to text-align:center. (I cannot use margin: auto, since I do not know the widths D1 - D4 in combination).
However, D1-D4 contains a bunch of images that I want to overlay. I can do this by setting position: relativeboth D1 and position:absoluteimg tags.
The problem is that this leads to the fact that D1-D4 seems to have no content, and they lose their ability to center using text-align: center! Is there any other way to achieve what I want?
source
share