Spalten mit CSS float

Bis display: flex bzw. display: grid auf den Plan traten, war float: left die Technik der Wahl, um Inhalte auf kleinen Monitoren sequentiell untereinander und auf großen Monitoren nebeneinander zu setzen.

Zwei Spalten

Pie caramels apple pie. Jelly beans marzipan pudding biscuit topping cookie cookie. Candy jujubes donut chocolate cake tootsie roll cookie. Carrot cake cheesecake pie fruitcake marzipan danish cupcake dessert. Lemon drops dessert gummi bears. Bonbon unerdwear.com bonbon oat cake applicake muffin. Unerdwear.com donut halvah liquorice fruitcake. Chocolate bear claw chupa chups.

Marzipan bear claw candy canes liquorice pie chocolate cake caramels tart powder. Wafer marshmallow marshmallow. Muffin caramels cookie lemon drops jujubes candy pudding. Cheesecake marzipan biscuit. Tart halvah pie. Donut sweet topping. Brownie jelly croissant ice cream apple pie jelly. Danish toffee unerdwear.com jelly beans. Wafer gummies toffee danish cake dessert toffee applicake.

Drei Spalten

Jelly-o pie dragée apple pie soufflé chocolate bar. Jujubes unerdwear.com jelly beans apple pie dragée liquorice. Oat cake toffee ice cream. Biscuit jelly beans bonbon jelly-o lollipop candy canes danish. Pudding sugar plum apple pie sugar plum fruitcake.

Toffee topping bear claw tootsie roll bear claw gummies pudding jelly. Tootsie roll bear claw chocolate bar cotton candy pudding sesame snaps sugar plum cheesecake dragée. Marshmallow candy liquorice. Topping chupa chups carrot cake soufflé cookie fruitcake bonbon.

Donut tiramisu pastry cotton candy chocolate bar. Cookie soufflé caramels ice cream muffin tiramisu brownie chocolate bar. Chocolate bar macaroon caramels oat cake lollipop soufflé carrot cake caramels. Danish macaroon liquorice pudding powder pudding.

Vier Spalten

Fruitcake applicake jujubes dragée lemon drops powder chocolate cake. Sesame snaps apple pie unerdwear.com. Jujubes croissant lollipop tart icing marzipan pie liquorice jelly. Danish chupa chups topping.

Caramels pie fruitcake fruitcake biscuit cookie bear claw wafer danish. Gummi bears bonbon jelly. Cupcake jujubes sesame snaps candy cake. Lollipop gummi bears muffin croissant apple pie sesame snaps cheesecake candy. Chupa chups lemon drops pudding bonbon icing.

Halvah chocolate cake topping chocolate cake cotton candy croissant cotton candy dessert oat cake. Biscuit chocolate bar apple pie oat cake pie cupcake. Topping gummies lollipop.

Chupa chups lollipop lemon drops marzipan chocolate chocolate bar pie fruitcake. Sesame snaps chocolate danish cotton candy tootsie roll macaroon. Muffin donut candy canes gingerbread. Unerdwear.com chupa chups danish apple pie toffee jujubes candy.

Zwei Drittel, ein Drittel

Croissant gummies chocolate bar chocolate bar halvah danish croissant. Pudding unerdwear.com sesame snaps soufflé wafer fruitcake. Wafer toffee sweet roll lollipop gingerbread. Sesame snaps sesame snaps sweet roll cake icing lemon drops.

Biscuit chocolate cake marzipan muffin sugar plum marshmallow donut cupcake. Cake wafer pastry pastry dragée. Brownie marshmallow halvah. Pudding muffin chocolate cake cupcake cheesecake. Jelly beans toffee tootsie roll cotton candy jelly beans cupcake cake.

Drei Viertel, ein Viertel

Carrot cake lollipop jelly-o jujubes croissant dessert. Donut jelly beans bear claw jelly. Gummies fruitcake sweet pastry marzipan. Dragée lemon drops chocolate cake fruitcake bonbon lollipop tootsie roll cheesecake. Carrot cake chocolate cake oat cake sweet soufflé apple pie. Cake pie wafer powder sugar plum halvah unerdwear.com chocolate cake chocolate cake.

Tiramisu chocolate bar applicake toffee jujubes. Oat cake cheesecake tootsie roll pie apple pie macaroon. Pie croissant sugar plum icing. Dragée caramels donut sweet sweet biscuit. Oat cake cookie jujubes. Cookie macaroon topping tootsie roll bonbon. Pastry sugar plum halvah jujubes icing sweet roll cookie cupcake danish. Wafer soufflé muffin cheesecake pie macaroon tart. Brownie unerdwear.com lollipop powder. Jujubes pudding bear claw muffin carrot cake wafer cake sugar plum.

Ein Drittel, zwei Drittel

Unerdwear.com cheesecake unerdwear.com bear claw. Tootsie roll halvah biscuit. Jelly lollipop biscuit. Cake candy gummi bears.

Chocolate cake candy canes marshmallow. Topping cupcake tart bear claw. Sweet roll ice cream croissant sweet. Dessert fruitcake halvah. Tart donut chupa chups cupcake danish candy. Brownie chocolate bar tart applicake sweet sesame snaps.

CSS für 2, 3, 4 Spalten mit float

<style>
.group,
[class*=colgroup] { zoom:1 }
.group:after,
[class*=colgroup]:after { /** Alle Elemente, deren class "colgroup" enthält **/
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden
}
.col { position:relative}
.col :first-child { margin-top:0}

@media all and (min-width: 30em) and (max-width: 49.99em) {
    [class*=colgroup] .col {
        float:left;
        width:47.5%;
        margin-left:5%
    }

    [class*=colgroup] .col:nth-of-type(2n+1),
    .colspan-2+.col {
        clear:left;
        margin-left:0
    }

    .colgroup-1 .col {
        width:100%;
        float:none;
        margin-left:0
    }

    .colgroup-3 .colspan-2,
    .colgroup-3 .colspan-2+.col,
    .colgroup-3 .col.primary,
    .colgroup-3 .col.secondary {
        width:100%;
        float:none;
        margin-left:0
    }
    .colgroup-3 .col.secondary { margin:2em 0 0 0 }
}



@media all and (min-width: 50em) {
    [class*=colgroup] .col {
    margin-left:5%;
    float:left
    }

    [class*=colgroup] .col:first-of-type { margin-left:0 }
    .colgroup-4 .col { width:21.2% }
    .colgroup-4 .col:nth-of-type(4n+1) {
        clear:left;
        margin-left:0
    }

    .colgroup-4 .col.colspan-3 { width:73.8%}
    .colgroup-3 .col { width:30%}
    .colgroup-3 .col:nth-of-type(3n+1) {
        clear:left;
        margin-left:0
    }

    .colgroup-3 .col.colspan-2 { width:64% }
    .colgroup-3 .col.middle {
        margin:0 auto;
        float:none
    }

    .colgroup-3 .col.colspan-2>p {
        line-height:1.4;
        margin-top:0.7em
    }

    .colgroup-3 .col.primary { float:right }
    .colgroup-3 .col.secondary {
        float:left;
        margin-left:0
    }

    .colgroup-2 .col { width:47.5%}
    .colgroup-2 .col:nth-of-type(2n+1) {
        clear:left;
        margin-left:0
    }
    .colgroup-1 .col {
        width:100%;
        margin-left:0
    }
}

</style>

HTML Markup

<h3>Zwei Spalten</h3>
<div class="colgroup-2">
    <div class="col">
        <img src="pink_cake.png" width="720" height="333" />
        <p>Pie caramels apple pie.  </p>
    </div>
    <div class="col">
        <img src="pudim.png" width="720" height="333" />
        <p>Marzipan bear claw candy canes liquorice</p>
    </div>
</div>

<h3>Drei Spalten</h3>
<div class="colgroup-3">
    <div class="col">
        <img src="small_cake.png" width="797" height="333" />
        <p>Jelly-o pie dragée apple pie soufflé chocolate bar. </p>
    </div>
    <div class="col">
        <img src="cake_and_candle.png" width="720" height="333" />
        <p>Toffee topping bear claw </p>
    </div>
…
</div>

<h3>Vier Spalten</h3>
<div class="colgroup-4">
    <div class="col">
        <img src="pumpkin-pie.png" width="720" height="333" />
        <p>Fruitcake applicake jujubes </p>
    </div>
    <div class="col">
        <img src="oaty-cake.png" width="720" height="333" />
        <p>Caramels pie fruitcake </p>
    </div>
…
</div>

<h3>Zwei Drittel, ein Drittel</h3>
<div class="colgroup-3">
    <div class="col colspan-2">
        <p>Croissant gummies chocolate bar  </p>
    </div>
    <div class="col">
        <p>Biscuit chocolate cake marzipan muffin</p>
    </div>
</div>

<h3>Drei Viertel, ein Viertel</h3>
<div class="colgroup-4">
    <div class="col colspan-3">
        <p>Carrot cake lollipop jelly-o jujubes  </p>
    </div>
    <div class="col">
        <p>Tiramisu chocolate bar applicake </p>
    </div>
</div>

<h3>Ein Drittel, zwei Drittel</h3>
<div class="colgroup-3">
    <div class="col">
        <p>Unerdwear.com cheesecake unerdwear.com </p>
    </div>
    <div class="col colspan-2">
        <p>Chocolate cake candy canes marshmallow. </p>
    </div>
</div>