Flexbox Tutoria Guide

 <!DOCTYPE html>

<html lang="en">


<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Flexbox Tutorial</title>

    <style>

        .container {

            height: 544px;

            width: 100%;

            border: 2px solid black;

            /* initialize the container as a flex box  */

            display: flex;

            /* flex properties for flex container  */

            /* default value of flex direction is row  */

            /* flex-direction: row; */

            /* flex-direction: column;

            flex-direction: row-reverse;

            flex-direction: column-reverse; */


            /* default value of flex-wrap is no-wrap  */

            /* flex-wrap: wrap; */

            /* flex-wrap: wrap-reverse; */

            /* flex-flow: row-reverse wrap; */


            /* justify-content: center;

            justify-content: space-between;

            justify-content: space-evenly;

            justify-content: space-around; */


            /* align-items: center;

            align-items: flex-end;

            align-items: flex-start;

            align-items: stretch; */

        }


        .item {

            width: 150px;

            height: 150px;

            background-color: tomato;

            border: 2px solid rgb(11, 216, 3);

            margin: 10px;

            padding: 3px;

        }


        #item-1 {

            /* flex properties for flex items  */

            /* higher the order, later it shows up in the container  */

            /* order: 2; */


            /* flex-grow: 2;

            flex-shrink: 2; */


        }


        #item-2 {

            /* flex-grow: 3;

            flex-shrink: 3; */


            flex-basis: 160px;

            /* when flex-direction is set to row flex-basis: will control width  */

            /* when flex-direction is set to column flex-basis: will control height   */


        }


        #item-3 {

            /* order: 40; */


            /* flex: 2 2 4px; */

            align-self: flex-start;

            align-self: flex-end;

            align-self: center;

        }

    </style>

</head>


<body>

    <h1>This is Flexbox Tutorial</h1>

    <div class="container">

        <div class="item" id="item-1">First Box</div>

        <div class="item" id="item-2">Second Box</div>

        <div class="item" id="item-3">Third Box</div>

        <!-- <div class="item" id="item-4">Fourth Box</div>

        <div class="item" id="item-5">Fifth Box</div>

        <div class="item" id="item-6">Sixth Box</div> -->

    </div>

</body>


</html>

Comments

Popular posts from this blog

Transform Property In CSS

More on CSS Selectors