Create Layout Of Your Website With HTML & CSS!!
1.HTML CODE:
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <link rel="stylesheet" type="text/css" href="stylegride.css">
- </head>
- <body>
- <main class="l">
- <div class="div1">Header</div>
- <div class="div2">Box1</div>
- <div class="div3">Box2</div>
- <div class="div4">Box3</div>
- <div class="div5">sidebar</div>
- <div class="div6">Maincontent</div>
- <div class="div7">Footer</div>
- </main>
- </body>
- </html>
2.CSS CODE:
- *{
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- main
- {
- width: 75%;
- margin: 50px auto;
- border: 1px solid black;
- display: grid;
- grid-template-rows: 60px 100px 200px 60px;
- grid-template-columns: repeat(3, 1fr) 150px;
- grid-gap: 20px;
- }
- .div1{background-color: red; color: white;
- grid-column: 1/-1}
- .div2{background-color: blue; color: white;}
- .div3{background-color: blue; color: white;}
- .div4{background-color: blue;color: white;}
- .div5{background-color: gray;color: white;
- grid-row: 2/4;
- grid-column: 4/5;
- }
- .div6{background-color: orange;color: white;
- grid-column: 1/4;
- }
- .div7{background-color: black;color: white;
- grid-column: 1/-1;
- }
No comments:
Post a Comment