A simple example of responsive wrapping layout with CSS Flex

If you have been living under a rock, then you probably have not heard about CSS Flexbox and Grid layouts. The old days of float layouts are over for responsive design! Now you can create simple responsive wrapping layouts with CSS Flex.

 So, without further ado, here is the example:

<style>

div.container {
    display: flex;
    justify-content: left;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 10px;
}

</style>

<div class="container">

    <div>Item 1</div>
    <div>Item 2</div>

</div>

There you go, an example on how to wrap child div elements or anything for that matter inside the parent container using Flex.

Comments

Popular posts from this blog

Build 6 is here

An example of chaining jQuery Ajax request callbacks

Creating hashtag hyperlinks on the fly for your website