Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide something in mobile/tablet view in Bootstrap 3?

I have a button in my Carousel slider that I would like displayed for desktop but hidden for mobile/tablet devices: http://www.doorsets.org.uk/index.php

Is this possible in Bootstrap 3? I'm aware that i can obviously change columns depending on devices, but I'm not clear on how to hide/display sections depending on the device.

Would appreciate any advice that could be offered. Also, is there a good Bootstrap 3 forum/s that you'd recommend?

Much appreciated NJ

like image 261
NathonJones Avatar asked Jan 15 '15 11:01

NathonJones


People also ask

How to hide a div in mobile view bootstrap?

To hide elements simply use the .d-none class or one of the .d-{sm,md,lg,xl}-none classes for any responsive screen variation.

How do you hide something in CSS Mobile?

To hide an element in a responsive layout, we need to use the CSS display property set to its "none" value along with the @media rule. The content of the second <p> element having a "hidden-mobile" class will be hidden on devices smaller than 767px.

What is d-none in bootstrap?

Use the d-none class to hide an element. Use any of the d-*-none classes to control WHEN the element should be hidden on a specific screen width.


1 Answers

Here is the documentation I believe you're looking for:

http://getbootstrap.com/css/#responsive-utilities-classes


You'll want to wrap the content you want to hide/show the desired class.

For example, if you want to hide a section on small(tablet) screens:

<section class="hidden-sm">
    <p>This content won't be visible on a tablet, or screen resolution ≥768p and < 992px</p>
</section>

Conversely, if you only want to show something on a tablet:

<section class="visible-sm">
    <p>This content will only be visible on a tablet, or screen resolution ≥768px and < 992px</p>
</section>

For your button, something like this will only appear on medium and large screens:

<div class="btn btn-primary visible-md visible-lg">Carousel Button</div>
like image 153
morganjlopes Avatar answered Jan 05 '23 01:01

morganjlopes