Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patelrohan/98a67e9442980433096433bb9697f480 to your computer and use it in GitHub Desktop.
Save patelrohan/98a67e9442980433096433bb9697f480 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";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment