Created
January 28, 2025 15:17
-
-
Save mikesusz/b438a47d12647aebe8b46a376ea17486 to your computer and use it in GitHub Desktop.
sizer-css
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
/* put a div in your html: <div id="sizer"></div> */ | |
#sizer { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
font-size: 0.5em; | |
color: white; | |
padding: 0.1em 0.25em; | |
text-align: center; | |
background-color: green; | |
opacity: 0.25; | |
} | |
#sizer:before { | |
content: "default"; | |
} | |
@media screen and (min-width: 400px) { | |
#sizer { | |
background-color: blue; | |
} | |
#sizer:before { | |
content: "$medium-screen"; | |
} | |
} | |
@media screen and (min-width: 910px) { | |
#sizer { | |
background-color: purple; | |
} | |
#sizer:before { | |
content: "$bigger-screen"; | |
} | |
} | |
@media screen and (min-width: 1200px) { | |
#sizer { | |
background-color: red; | |
} | |
#sizer:before { | |
content: "$hugest-screen"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment