Last active
January 26, 2021 17:08
-
-
Save acidtone/0f9c31e820f29511fc2671063fd71c58 to your computer and use it in GitHub Desktop.
Media queries: max-width (open)
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Desktop First: max-width</title> | |
<style> | |
/* Set default styles. In this case, styles for desktop. */ | |
body { | |
background-color: grey; | |
} | |
/* Place medium screen media queries here, if needed. */ | |
@media screen and (max-width: 40rem) { | |
body { | |
background-color: rebeccapurple; | |
} | |
} | |
/* Small screens */ | |
@media screen and (max-width: 25rem) { | |
/* Override default styles (or declare new ones) when screen is narrower than 600px ("mobile"). */ | |
body { | |
background-color: skyblue; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment