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
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.
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.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With