Skip to content

Instantly share code, notes, and snippets.

@PaluMacil
Created September 23, 2016 13:33
Show Gist options
  • Save PaluMacil/6cc5935d760823ca0f0ed7f457fafd44 to your computer and use it in GitHub Desktop.
Save PaluMacil/6cc5935d760823ca0f0ed7f457fafd44 to your computer and use it in GitHub Desktop.
Hide text when small
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hidey Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<!-- These classes hide content from small and very small screens: hidden-sm , hidden-xs
This uses a media query in Bootstrap's CSS, not JavaScript, so it's always avaialble for Bootstrap.
-->
<div class="container">
<div class="row">
<h1>This is always visible!</h1>
</div>
<div class="row hidden-xs">
<h1>This is hidden under 768 pixels!</h1>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment