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.
/images/forum/upload/2014-10-01/264c0f3729fc965cda7f88072fc559bd.png
Thanks

Post a Reply

Replies

Oldest  Newest  Rating
+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
0 chris elviss · March 6, 2015
More about Div positioning...

http://www.corelangs.com/css/box/divindiv.html

Chris
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.
  • 1

HTML / CSS / Web Design

107,333 followers
About

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

Links
Moderators