-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<style> | ||
* { | ||
margin: 0px; | ||
padding: 0px; | ||
font-family: Verdana, Geneva, Tahoma, sans-serif; | ||
|
||
} | ||
|
||
body { | ||
background-color: #5a5757; | ||
|
||
} | ||
|
||
.container { | ||
display: grid; | ||
grid-template-columns: repeat(5, 20vw); | ||
grid-template-rows: repeat(5, 20vh); | ||
gap: 5px; | ||
} | ||
|
||
.div1 { | ||
background-color: aquamarine; | ||
} | ||
|
||
.div2 { | ||
background-color: rgb(126, 54, 214); | ||
} | ||
|
||
.div3 { | ||
background-color: rgb(141, 32, 108); | ||
} | ||
|
||
.div4 { | ||
background-color: rgb(45, 208, 20); | ||
} | ||
|
||
.div5 { | ||
background-color: rgb(228, 165, 18); | ||
} | ||
|
||
/* media query */ | ||
/* Extra small devices (phones, 600px and down) */ | ||
@media only screen and (max-width: 600px) { | ||
.div1{ | ||
grid-column: 1/6; | ||
grid-row: 1/2; | ||
} | ||
.div2{ | ||
grid-column: 1/6; | ||
grid-row: 5/6; | ||
} | ||
.div3{ | ||
grid-row: 2/3; | ||
grid-column: 1/6; | ||
} | ||
.div4{ | ||
grid-column: 1/6; | ||
grid-row: 3/4; | ||
} | ||
.div5{ | ||
grid-column: 1/6; | ||
grid-row: 4/5; | ||
} | ||
} | ||
|
||
/* Small devices (portrait tablets and large phones, 600px and up) */ | ||
@media only screen and (min-width: 600px) { | ||
.div1{ | ||
grid-column: 1/6; | ||
grid-row: 1/2; | ||
} | ||
.div2{ | ||
grid-column: 1/3; | ||
grid-row: 2/3; | ||
} | ||
.div3{ | ||
grid-row: 2/3; | ||
grid-column: 3/6; | ||
} | ||
.div4{ | ||
grid-column: 1/3; | ||
grid-row: 3/6; | ||
} | ||
.div5{ | ||
grid-column: 3/6; | ||
grid-row: 3/6; | ||
} | ||
} | ||
|
||
/* Large devices (laptops/desktops, 992px and up) */ | ||
@media only screen and (min-width: 992px) { | ||
.div1{ | ||
background-color: aqua; | ||
grid-column: 1/6; | ||
} | ||
|
||
.div2{ | ||
background-color: rgb(67, 46, 230); | ||
grid-row: 2/5; | ||
grid-column: 1/2; | ||
z-index: 1; | ||
} | ||
|
||
.div3{ | ||
background-color: rgb(246, 59, 162); | ||
grid-column: 2/5; | ||
grid-row: 2/5; | ||
} | ||
.div4{ | ||
background-color: rgb(103, 234, 119); | ||
grid-row: 2/5; | ||
grid-column: 5/6; | ||
} | ||
.div5{ | ||
background-color: rgb(199, 246, 59); | ||
grid-column: 1/6; | ||
grid-row: 5/6; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="div1">div1</div> | ||
<div class="div2">div2</div> | ||
<div class="div3">div3</div> | ||
<div class="div4">div4</div> | ||
<div class="div5">div5</div> | ||
</div> | ||
</body> | ||
|
||
</html> |