Hide content depending on screen size with Bootstrap


Use the .hidden-* class in Bootstrap to hide content depending on screen size with Bootstrap

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <p class = "show">This is visible.</p>
      <p class = "hidden">This is hidden.</p>
      <h1 class = "hidden-sm bg-info">Hidden on small screen</h1>
      <h1 class = "hidden-md bg-warning">Hidden on medium screen</h1>
   </body>
</html>

Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician

Updated on: 12-Jun-2020

444 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements