display grid practice

technical talkiess
0

display grid practice

grid-template-columns

grid-gap


 <!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>Display Grid</title>
</head>
<style>
    .container{
        display: grid;
        /* three column first column 300px second 100px third 100px */
        /* grid-template-columns: 300px 100px 100px; */
        /* three column first column 300px second auto third 100px */
        /* grid-template-columns: 300px auto 100px; */
         /* three column in fr - fragments */
         grid-template-columns: 1fr 3fr 1fr;
         grid-template-columns:repeat(4,auto) ;
        grid-gap: 3rem;


    }
    .box{
        background-color: yellow;
        color: black;
        border: 1px solid black;
        margin: 3px;

    }
</style>
<body>
        <div class="container">
            <div class="box">this is dummy box.1</div>
            <div class="box">this is dummy box.2</div>
            <div class="box">this is dummy box.3</div>
            <div class="box">this is dummy box.4</div>
            <div class="box">this is dummy box.5</div>
            <div class="box">this is dummy box.6</div>
            <div class="box">this is dummy box.7</div>
            <div class="box">this is dummy box.8</div>
        </div>
</body>
</html>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)