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
Post a Comment