1 | <div class="box"><br /> <div class="in in1"></div><br /> <div class="in in2"></div><br /> <div class="in in3"></div><br /> <div class="in in4"></div><br /></div><br /><br /><style><br /> .box {width: 100%;}<br /> .box .in {width: 50%; height: 200px; float: left;}<br /> .in1 {background: yellow;}<br /> .in2 {background: green;}<br /> .in3 {background: red;}<br /> .in4 {background: blue;}<br /></style> |
Czy o to chodzi? Przykład online: https://jsfiddle.net/mvnw0puq/
pjotruh
html, body { margin: 0; height: 100% }div.a { background: yellow; height: 300px; }div.b { background: gray; height: calc(100% - 300px; }Górny DIV o klasie "a" ma wysokość 300px, dolny DIV o klasie "b" ma wysokość całej strony, pomniejszony o wysokość górnego DIVa - zatem dolny DIV wypełnia pozostałą część strony pod DIVem górnym.2024-09-17 23:28:56