Skip to content

Instantly share code, notes, and snippets.

@acidtone
Last active January 26, 2021 16:59
Show Gist options
  • Save acidtone/8b22888818aa6f81653ab0858ad4c418 to your computer and use it in GitHub Desktop.
Save acidtone/8b22888818aa6f81653ab0858ad4c418 to your computer and use it in GitHub Desktop.
Media queries: min-width (open)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mobile First: min-width</title>
<style>
/* Set default styles. In this case, styles for mobile. */
body {
background-color: grey;
}
/* Place medium screen media queries here, if needed. */
@media screen and (min-width: 40rem) {
/* Override default styles (or declare new ones) when screen is larger than 600px ("desktop"). */
body {
background-color: rebeccapurple;
}
}
/* Large screens */
@media screen and (min-width: 75rem) {
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