Created
June 5, 2024 17:13
-
-
Save fcFn/62a7a1a596113f2b1bb03abbdcd8b38d to your computer and use it in GitHub Desktop.
Basic CSS media query template
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
| /* Base styles for mobile devices */ | |
| body { | |
| font-family: Arial, sans-serif; | |
| margin: 0; | |
| padding: 0; | |
| background-color: lightblue; | |
| } | |
| .container { | |
| width: 100%; | |
| padding: 10px; | |
| } | |
| .header { | |
| font-size: 1.5em; | |
| } | |
| .content { | |
| font-size: 1em; | |
| } | |
| /* Styles for tablets (medium screens) */ | |
| @media only screen and (min-width: 601px) { | |
| body { | |
| background-color: lightgreen; | |
| } | |
| .container { | |
| width: 90%; | |
| padding: 20px; | |
| } | |
| .header { | |
| font-size: 2em; | |
| } | |
| .content { | |
| font-size: 1.2em; | |
| } | |
| } | |
| /* Styles for desktops (large screens) */ | |
| @media only screen and (min-width: 1025px) { | |
| body { | |
| background-color: lightcoral; | |
| } | |
| .container { | |
| width: 80%; | |
| padding: 30px; | |
| } | |
| .header { | |
| font-size: 2.5em; | |
| } | |
| .content { | |
| font-size: 1.5em; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment