Gewusst wie: Responsives Zickzack-Layout
Erfahren Sie, wie Sie mit CSS ein ansprechendes Zick-Zack-Layout (abwechselnd) erstellen.
So erstellen Sie ein Zick-Zack-Layout
Schritt 1) HTML hinzufügen:
Beispiel
<div class="container">
<div class="row">
<div
class="column-66">
...
</div>
<div class="column-33">
...
</div>
</div>
</div>
<div
class="container">
<div class="row">
<div
class="column-33">
...
</div>
<div class="column-66">
...
</div>
</div>
</div>
Schritt 2) CSS hinzufügen:
Beispiel
* {
box-sizing: border-box;
}
.container {
padding: 64px;
}
/* Clear floats */
.row:after {
content: "";
display: table;
clear: both
}
/* 2/3 column */
.column-66 {
float: left;
width:
66.66666%;
padding: 20px;
}
/* 1/3 column */
.column-33
{
float: left;
width:
33.33333%;
padding: 20px;
}
/* Add responsiveness - make
the columns appear on top of each other instead of next to each other on small
screens */
@media screen and (max-width: 1000px) {
.column-66,
.column-33 {
width: 100%;
text-align: center;
}
}
Tipp: Gehen Sie zu unserem CSS-Website-Layout -Tutorial, um mehr über Website-Layouts zu erfahren.
Tipp: Gehen Sie zu unserem CSS Responsive Webdesign Tutorial, um mehr über responsives Webdesign und Grids zu erfahren.