Gewusst wie: Vierspaltiges Layout
Erfahren Sie, wie Sie mit CSS ein 4-Spalten-Layoutraster erstellen.
So erstellen Sie ein vierspaltiges Layout
Schritt 1) HTML hinzufügen:
Beispiel
<div class="row">
<div class="column"></div>
<div
class="column"></div>
<div
class="column"></div>
<div
class="column"></div>
</div>
Schritt 2) CSS hinzufügen:
In diesem Beispiel erstellen wir ein vierspaltiges Layout:
Beispiel
.column {
float: left;
width: 25%;
}
/* Clear floats after the
columns */
.row:after {
content: "";
display: table;
clear: both;
}
In diesem Beispiel erstellen wir ein responsives vierspaltiges Layout:
Beispiel
/* Responsive layout - when the screen is less than 600px wide, make the
three
columns stack on top of each other instead of next to each other */
@media
screen and (max-width: 600px) {
.column {
width: 100%;
}
}
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.