css - divs positioning in parent div keeping aspect ratio by height -


i have 1 div container , want position 10 divs inside it.

------------ ||---||---||    <- container || 1 || 2 || ||---||---|| ||---||---|| || 3 || 4 || ||---||---|| ||---||---|| || 5 || 6 || ||---||---|| ||---||---|| || 7 || 8 || ||---||---|| ||---||---|| || 9 || 10|| ||---||---|| ------------ 

i want these divs squares, in 2 columns , want them 20% of parent height. parent div must not allowed change width less sum of 2 inner divs , ok extended (inner divs must attached left)

i'm seeking solution css.

you can use calc(); option in css.

for example; if wrapper div 100% in height, 100vh. can use set inner divs width , height:

.innerdiv {     height: 20vh;     width: 20vh; } 

read here: https://css-tricks.com/viewport-sized-typography/

support decent: http://caniuse.com/#search=vw


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -