Skip to content

Instantly share code, notes, and snippets.

@mfurlend
Last active October 2, 2015 17:34
Show Gist options
  • Save mfurlend/3fefd98458272d612376 to your computer and use it in GitHub Desktop.
Save mfurlend/3fefd98458272d612376 to your computer and use it in GitHub Desktop.
Display your current viewport (xs, sm, md or lg) context when using Bootstrap
/*Detect Your Current Viewport Context
This small CSS snippet will display your current viewport (xs, sm, md or lg) context when using Bootstrap. It can be useful for testing responsive sites, or demoing responsive behaviors on different viewports. Hope it helps someone out there!
*/
body::before {
content: "xs";
position: fixed;
top: 0;
left: 0;
z-index: 9999999;
background-color: #000;
color: #fff;
}
@media (min-width : 768px) { body::before { content: "sm"; }}
@media (min-width : 992px) { body::before { content: "md"; }}
@media (min-width : 1200px) { body::before { content: "lg"; }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment