Home  >  Article  >  Web Front-end  >  How to set the mobile element to be hidden in bootstrap

How to set the mobile element to be hidden in bootstrap

藏色散人
藏色散人Original
2020-11-25 10:40:014303browse

Bootstrap sets the method to hide elements on the mobile side: first open the corresponding code file; then use Bootstrap's grid system; and finally use "visible-xs-block" to set the display and hide on ultra-small devices and mobile phones.

How to set the mobile element to be hidden in bootstrap

The operating environment of this tutorial: Windows 7 system, bootstrap version 3. This method is suitable for all brands of computers.

Recommended: "bootstrap Tutorial"

Bootstrap Control the hiding and display of elements on the mobile and web pages

Look at the effect first

  • PC, display 3 pictures

How to set the mobile element to be hidden in bootstrap

  • Mobile version, only one page is displayed

How to set the mobile element to be hidden in bootstrap

The solution is to use Bootstrap’s grid system.

  • visible-md-block indicates that it can be displayed on early and medium-sized desktop computers (≥992px)

  • visible-lg-block indicates that it can be displayed on large-sized devices The device desktop computer (≥1200px) can display

  • visible-xs-block means that the ultra-small device mobile phone (

Code:

 <p class="container">
    <p class="row">
        <p class="col-md-3 visible-md-block visible-lg-block">
            <a >
                <img  src="images/tm-sigma-00.jpg" class="img-responsive"   style="max-width:90%" alt="How to set the mobile element to be hidden in bootstrap" >    
            </a>
        </p>
        <p class="col-md-6 visible-xs-block visible-md-block visible-lg-block">
            <a >
                <img  src="images/tm-sigma-00.jpg" class="img-responsive" data-preview-src="" data-preview-group="1"   style="max-width:90%" alt="How to set the mobile element to be hidden in bootstrap" > 
            </a>
        </p>
        <p class="col-md-3 visible-md-block visible-lg-block">
            <a >
                <img  src="images/tm-sigma-00.jpg" class="img-responsive"   style="max-width:90%" alt="How to set the mobile element to be hidden in bootstrap" >    
            </a>
        </p>
    </p>
    </p>

                 

For more programming-related knowledge, please visit: Programming Learning! !

The above is the detailed content of How to set the mobile element to be hidden in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn