Skip to main content

Use CSS variable-(grid, grid-area)

 This is CSS sheet()

/* grid variable */
.grid-cont{
    display: grid;
    grid-template-columns: auto auto auto auto auto auto;
}
.grid-cont > div{
      background-color: coral;
      border: 2px solid black;
      text-align: center;
      padding: 20px;
}
.item1{
    grid-column: 1/7;
}
.item2{
    grid-column: 1/2;
    grid-row: 2/4;
   
}
.item3{
    grid-column: 2/6;
}
.item4{
    grid-column: 6/7;
}
.item5{
    grid-column: 2/7;
}
/* grid area variable */
.grid-cont2{
    display: grid;
    grid-template-areas:
    'header header header header header header'
    'menu main main main aside aside'
    'menu footer footer footer footer footer'
    ;
}
.grid-cont2 > div{
    background-color: darkgoldenrod;
    border: 3px solid green;
    text-align: center;
    padding: 20px;
}
.item6{grid-area: header;}
.item7{grid-area: menu;}
.item8{grid-area: main;}
.item9{grid-area: aside;}
.item10{grid-area: footer;}

This is HTML sheet

 <div class="grid-cont">
            <div class="item1">Hedar</div>
            <div class="item2">Menu</div>
            <div class="item3">Main</div>
            <div class="item4">Aside</div>
            <div class="item5">Footer</div>
        </div>
        <div class="div-clear"></div><br>
        <h3>Same laout but other CSS veriable</h3>
        <div class="grid-cont2">
            <div class="item6">Hedar</div>
            <div class="item7">Menu</div>
            <div class="item8">Main</div>
            <div class="item9">Aside</div>
            <div class="item10">Footer</div>
        </div>

Comments

Popular posts from this blog

feture

Use  <nav>,<figure>,<ifrem>,<samp>,<var> Tag < 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" >   < style >     header {       text-align : center ;     }     body {       background-color : rgb ( 196 , 152 , 72 );     }     .agp {       width : 100% ;       height : 250px ;    }     .fcss {     border : 3px solid red ;     border-radius : 5px ;     padding : 5px ;     margin : 2px ;     width : 50% ;    }     .fs {       text-align : center ;     }     .t1 , .t2 , .t3 , .t4 {       background-colo...
Use CSS variable (form and list style)  If you want icon like -list ..Go to this wed -site : https://fontawesome.com/v5.15/icons?d=gallery&p=2&q=tick And attest HTML <header> this link : <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> This is CSS sheet /* form style */ .text-are12 {     resize : none ;     border : 3px solid rgb ( 71 , 3 , 3 );     border-radius : 5px ;     margin : 10px ; } input [ type = "submit" ], input [ type = "reset" ]{     width : 90px ;     border : none ;     margin : 10px ;     border-radius : 5px ;     padding : 5px ;     background-color : olivedrab ;     color : white ;     cursor : pointer...