Search code examples
csshtmlautoresize

CSS multiple elements auto position


I am working on a mobile website with four divs that need to be positioned according to the width of the parent div. I need the divs to divide up the space in between evenly. Here are a few examples:

When the width is 500px it might look something like this,

img1

and when it is 300px,

img2


Solution

  • Check the following article: Center Multiple DIVs with CSS.

    There is a this similar SO question also.