Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Bootsrap 4 display utility correct usage

$
0
0

According to the bootstrap documentation, to use the visibility utility provided from the framework it's necessary to use the d-none to not display an element or the d-* with the relative breakpoint to set an element to be visible only on mobile tablet or desktop. I'm facing an issue with this concept, but maybe I'm using the wrong way to do this. I have these example of image that I want to be displayed only on mobile or desktop

<img class="img-fluid w-100 d-sm-none d-md-none d-lg-block desktop-cover" src="...">
<img class="img-fluid w-100 d-lg-none d-md-block d-sm-block mobile-cover" src="...">

The first will appear also on mobile and tablet and I don't want this, I think that the classes are set correctly? To solve this I've added the .d-none class but not work as expected. The second works fine and is displayed only on mobile and tablet. Can someone tell me how to correctly use the display utility of bootstrap and what's wrong with the implementation I've done?


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>