Gewusst wie: Responsive Floats
Erfahren Sie, wie Sie responsive Floating-Elemente mit CSS erstellen.
Ansprechende Schwimmer
Verwenden Sie Medienabfragen und legen Sie die angegebene Bildschirmbreite (in Pixel) fest, wenn das Element schweben soll:
Beispiel
/* Float to the right on screens that are equal to or less than 768px wide */
@media (max-width: 768px) {
.float-right-sm {
float: right;
}
}
/* Float to the right on screens that
are equal to or greater than 769px wide */
@media (min-width: 769px) {
.float-right-lg {
float: right;
}
}
Tipp: Erfahren Sie mehr über Floats in unserem CSS-Float -Tutorial.