Twitter bootstrap hide element on small devices

后端 未结 4 1755
我寻月下人不归
我寻月下人不归 2020-12-13 01:37

I have this code:

4条回答
  •  半阙折子戏
    2020-12-13 01:59

    For Bootstrap 4.0 there is a change

    See the docs: https://getbootstrap.com/docs/4.0/utilities/display/

    In order to hide the content on mobile and display on the bigger devices you have to use the following classes:

    d-none d-sm-block
    

    The first class set display none all across devices and the second one display it for devices "sm" up (you could use md, lg, etc. instead of sm if you want to show on different devices.

    I suggest to read about that before migration:

    https://getbootstrap.com/docs/4.0/migration/#responsive-utilities

提交回复
热议问题