Grid span in css

technical talkiess
0

 Grid span:


<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

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

    <title>Grid Span</title>

</head>

<style>

    .container{

        display: grid;

        grid-template-columns: repeat(4,1fr);

    }

    .box{

        background-color: antiquewhite;

        padding: 2px ;

        border: 1px solid black;

        margin: 2px;

    }

    .box:first-child{

        /* apko column kitne span karne hai wo dalna padta hai isme  */

        grid-column-start:1;

        grid-column-end:3;

        /* same chij aap jo hai na wo row ke liye bhi kar sakte hai  */

        grid-row-start: 1;

        grid-row-end: 6;

        /* iska short kat bhi hai jo aap log use kar sakte hai  */

        grid-column: 1 / span 2;

        grid-row: 1 / span 6;

    }

</style>

<body>

    <div class="container">

        <div class="box">item-1</div>

        <div class="box">item-2</div>

        <div class="box">item-3</div>

        <div class="box">item-4</div>

        <div class="box">item-5</div>

        <div class="box">item-5</div>

        <div class="box">item-5</div>

        <div class="box">item-5</div>

        <div class="box">item-5</div>

        <div class="box">item-5</div>

    </div>

</body>

</html>

Post a Comment

0Comments

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

Post a Comment (0)