Zum Hauptinhalt springen

Grid Layout Praxis

Grid flex-und-grid

h3 Grid flex-und-grid

Html:
 <div class="grid-elternelement">
    <div class="grid-header"></div>
    <div class="grid-main"></div>
    <div class="grid-footer"></div>
</div>   
 
 
CSS:
.grid-elternelement div {  <== Div's sichtbar machen
    text-align: center;
    border: 2px solid green;
}

.grid-elternelement {
    display: grid;   <== Elternelement als Grid deklarieren (wirkt sich nur auf die direkten Kinder aus)
    max-width: 100%;
    padding: 10px;
    margin: 20px auto;
    grid-template-columns: auto auto auto; <== Spaltenanzahl festlegen
    border: 2px solid red;
}

Beispiel 4: Grid,- einfach genial. Perfekt responsive ;-)

Text hier

1
2
3
4
5
6
7
8

Beispiel Grid auto-fit

1
2
3
4

Beispiel 14: Grid Gallery


Hero Content and a List of Articles

You thirsty?

Explore local breweries with just one click and stirred by starlight across the centuries light years great turbulent clouds circumnavigated paroxysm of global death.

Browse Breweries