Skip to content

Instantly share code, notes, and snippets.

@WebDevSimplified
Last active May 4, 2024 21:33
Show Gist options
  • Save WebDevSimplified/d7deffbd6631834003ad07ca60aaf906 to your computer and use it in GitHub Desktop.
Save WebDevSimplified/d7deffbd6631834003ad07ca60aaf906 to your computer and use it in GitHub Desktop.
This stylesheet adds text describing the current Bootstrap Breakpoint in the top right corner of the screen.
body {
margin-top: 40px; /* This margin just makes the text easier to read. You can remove it if you want since it can mess with your other styles. */
}
body::before {
content: "XS";
color: red;
font-size: 2rem;
font-weight: bold;
position: fixed;
top: 0;
right: 0;
}
/* This box class is purely used for explaining how the bootstrap grid system works. */
.box {
background-color: lightblue;
border: 1px solid blue;
min-height: 50px;
font-size: 2rem;
}
@media (min-width: 576px) {
body::before {
content: "SM";
}
}
@media (min-width: 768px) {
body::before {
content: "MD";
}
}
@media (min-width: 992px) {
body::before {
content: "LG";
}
}
@media (min-width: 1200px) {
body::before {
content: "XL";
}
}
@media (min-width: 1400px) {
body::before {
content: "XXL";
}
}
@hoangphatdev
Copy link

thank a lot

@KrisQK
Copy link

KrisQK commented May 4, 2024

xiexie ni, thankyou a lot. I hope you have a great day as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment