Skip to content

Commit

Permalink
Media query testings
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmti2016 committed May 23, 2020
1 parent ebe4c67 commit 9cfd2f5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
48 changes: 48 additions & 0 deletions media-query.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
*,
*::after,
*::before {
box-sizing: border-box;
}

body {
margin: 0;
font-family: "Roboto", sans-serif;
font-size: 1.3rem;
}

.example {
width: 90%;
margin: 5em auto;
padding: 10em 0;
background-color: steelblue;
}

/*
Mobile first, the default style is mobile
And for bigger screen you overrride
the style as needed (the specified properties)
*/

/* The order is relevant */

/* 600px or bigger */
@media (min-width: 600px) {
.example {
background-color: olivedrab;
}
}
@media (min-width: 800px) {
.example {
background-color: orangered;
}
}
/* Desktop first */
/* 600px or smaller */
@media (max-width: 600px) {
.example {
background-color: red;
}
}
/* Between 600px and 900px */
@media (min-width: 600px) and (max-width: 900) {
}
12 changes: 12 additions & 0 deletions media-query.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="media-query.css" />
</head>
<body>
<div class="example"></div>
</body>
</html>

0 comments on commit 9cfd2f5

Please sign in to comment.