Skip to content

Instantly share code, notes, and snippets.

@keriati
Created April 30, 2012 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keriati/2558487 to your computer and use it in GitHub Desktop.
Save keriati/2558487 to your computer and use it in GitHub Desktop.
I have no idea...
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
@media all and (max-width: 640px) {
body:after {
content: 'small';
display: none;
}
}
@media all and (min-width: 641px) {
body:after {
content: 'big';
display: none;
}
}
</style>
</head>
<body>
<h1>Screen size is:</h1>
<p id="target"></p>
<script type="text/javascript">
(function() {
window.mqsize = window.getComputedStyle(document.body,':after').getPropertyValue('content');
document.getElementById('target').innerHTML = window.mqsize;
}())
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment