CSS - Dynamically move and center side by side divs

+1 Brandon Quirarte · October 1, 2014
I am creating a webpage which has 2 divs side by side inside another div.  I want to have them dynamically move and align themselves vertically and centered when the web page's width is narrowed past a certain point.  I can get them to move and align vertically but cannot get them centered after doing so.  Any suggestions on how to do this?  

Here is an image that shows what I want if my description doesn't make sense.

Post a Reply


Oldest  Newest  Rating
0 chris elviss · March 6, 2015
More about Div positioning...


0 Phillip Drake · October 2, 2014
Once your webpage drops into a one column layout, set the parent container of the smaller divs to position: relative and then set the small divs' margins to auto.  I hope this helps also.
+2 Samuel Oloruntoba · October 1, 2014
i created a something little to demonstrate, okay this url( http://cssdeck.com/labs/ku5qt8j7 ) is for the source code, while this url( http://cssdeck.com/labs/full/ku5qt8j7 ) is for the demo. if you don't understand just post and i'll try to explain
  • 1

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.