Created
May 29, 2021 11:32
-
-
Save AmigoDheena/d543369308c23dc6198489104366f894 to your computer and use it in GitHub Desktop.
Screen sizes and break points for responsive design
This file contains hidden or 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
<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"> | |
<title>Media Query</title> | |
<style> | |
h1{ | |
display: none; | |
} | |
@media(max-width:550px) { | |
#smartphone h1{ | |
display: block; | |
} | |
body{ | |
background-color: violet; | |
} | |
} | |
@media (min-width:551px) and (max-width:768px) { | |
#tablet h1{ | |
display: block; | |
} | |
body{ | |
background-color: blueviolet; | |
} | |
} | |
@media (min-width:769px) and (max-width:1024px){ | |
#normal h1{ | |
display: block; | |
} | |
body{ | |
background-color: royalblue; | |
} | |
} | |
@media (min-width:1025px){ | |
#widescreen h1{ | |
display: block; | |
} | |
body{ | |
background-color: wheat; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div id="smartphone"><h1>Smartphone</h1></div> | |
<div id="tablet"><h1>Tablet</h1></div> | |
<div id="normal"><h1>Normal</h1></div> | |
<div id="landscape"><h1>Landscape</h1></div> | |
<div id="widescreen"><h1>Widescreen</h1></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment