html - Responsive Div Layout Rearrangement -
i've been working independently on designing website local company , i've been stuck on how make layout/design work responsively. of right now, content looks similar this:
however, browser screen decreases, or if browser on smaller resolution, item 3 shift below both item 1 , item 2 width of 100%. while both item 1 , item 2 inline each other. this:
initially, had both wrapping divs (1 , 2) set display: inline-block
. couldn't find sort of research said (after changing inline-block div container 2 in respective media query) child element inline separate element while child element in same container not. recently, i've started debating use of display: table
, display: table-row
, , display: table-cell
try , organize content in table-like layout, couldn't find way assign item 1 , item 2 own row while excluding item 3.
honestly it's been while since i've had mess html/css/javascript/etc., i'm little rusty. i'm hoping see if can point me in right direction or give me insight. thanks.
i used fluid design basic div's can see here https://jsfiddle.net/74x5975j/6/
<div class="group"> <div class="box-1">box 1</div> <div class="box-2">box 2</div> <div class="box-3">box 3</div> </div>
here css media query:
.group { width: 600px; height: 300px; } .box-1 { width: 50%; height: 100%; float: left; background-color: gray; text-align: center; float: left; } .box-2 { width: 50%; height: 50%; float: left; background-color: blue; text-align: center; float: left; } .box-3 { width: 50%; height: 50%; float: left; background-color: red; text-align: center; float: left; } @media screen , (max-width: 599px){ .group { width: 100%; height: 450px; } .box-1 { height: 66.666%; } .box-2 { height: 66.666%; } .box-3 { width: 100%; height: 33.333%; } }
Comments
Post a Comment