亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
Use Bootstrap Display Utilities
Alternative Combinations
Reverse: Show Only on Mobile
Home Web Front-end Bootstrap Tutorial How to hide an element on mobile in Bootstrap?

How to hide an element on mobile in Bootstrap?

Oct 16, 2025 am 10:43 AM
Mobile terminal

To hide an element on mobile in Bootstrap, use d-none d-sm-block to hide on extra-small screens and show on small and larger screens, adjusting breakpoints as needed.

How to hide an element on mobile in Bootstrap?

To hide an element on mobile devices in Bootstrap, use responsive display utility classes. These classes control visibility based on screen size, allowing you to show or hide elements at specific breakpoints.

Use Bootstrap Display Utilities

Bootstrap provides display utility classes that target different device sizes. To hide an element on mobile, apply a class that hides it on small screens (xs) while optionally showing it on larger ones.

Hide only on mobile (extra-small screens):

This element is hidden on mobile
  • d-none hides the element by default (on xs screens)
  • d-sm-block shows it as a block element on small and larger screens

Alternative Combinations

You can adjust the behavior depending on your layout needs:

  • d-none d-md-block – hide on xs and sm, show on medium and up
  • d-none d-lg-block – hide on xs, sm, md; show only on large and up
  • d-sm-none d-md-block – hide only on small screens, show elsewhere

Reverse: Show Only on Mobile

If needed, show an element only on mobile and hide on larger screens:

Visible only on mobile
  • d-block shows it on xs
  • d-sm-none hides it from small and up

These classes work with any display type (inline, flex, etc.)—just replace block with flex, inline, etc., as needed.

Basically, pick the right combination of d-{breakpoint}-none and d-{breakpoint}-* to control visibility across devices.

The above is the detailed content of How to hide an element on mobile in Bootstrap?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

ArtGPT

ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT

Stock Market GPT

AI powered investment research for smarter decisions

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

How to use mobile gesture operations in Vue projects How to use mobile gesture operations in Vue projects Oct 08, 2023 pm 07:33 PM

How to use mobile gesture operations in Vue projects With the popularity of mobile devices, more and more applications need to provide a more friendly interactive experience on the mobile terminal. Gesture operation is one of the common interaction methods on mobile devices, which allows users to complete various operations by touching the screen, such as sliding, zooming, etc. In the Vue project, we can implement mobile gesture operations through third-party libraries. The following will introduce how to use gesture operations in the Vue project and provide specific code examples. First, we need to introduce a special

Solve the problem of multi-touch points on Vue mobile terminal Solve the problem of multi-touch points on Vue mobile terminal Jun 30, 2023 pm 01:06 PM

In mobile development, we often encounter the problem of multi-finger touch. When users use multiple fingers to swipe or zoom the screen on a mobile device, how to accurately recognize and respond to these gestures is an important development challenge. In Vue development, we can take some measures to solve the problem of multi-finger touch on the mobile terminal. 1. Use the vue-touch plug-in vue-touch is a gesture plug-in for Vue, which can easily handle multi-finger touch events on the mobile side. We can install vue-to via npm

A complete guide to implementing mobile responsive layout in Vue (Vant) A complete guide to implementing mobile responsive layout in Vue (Vant) Jun 09, 2023 pm 04:09 PM

A Complete Guide to Implementing Mobile Responsive Layout in Vue (Vant) Mobile responsive layout is a very important part of modern web development. With the popularity of mobile devices, how to quickly respond to the size and resolution of the user's mobile phone screen has become a One of the challenges front-end engineers have to face. The Vue framework comes with responsive layout features, and there are also many third-party libraries to help us implement responsive layout. Among them, Vant component library is a Vue mobile UI library because it is very powerful, easy to use and customized, and is fully compatible with mobile devices.

How to solve the double-click amplification problem on mobile terminals in Vue development How to solve the double-click amplification problem on mobile terminals in Vue development Jun 29, 2023 am 11:06 AM

With the popularity of mobile devices, using Vue for mobile development has become a common choice. However, we often face a problem during mobile development, which is double-clicking to zoom in. This article will focus on this problem and discuss how to solve the specific method of double-click amplification on the mobile terminal in Vue development. The double-click enlargement problem on mobile devices occurs mainly because the mobile device automatically enlarges the zoom ratio of the web page when double-clicking on the touch screen. For general web development, this kind of double-click to enlarge is usually beneficial because it can

What is a cross-border e-commerce platform focusing on mobile terminals? What is a cross-border e-commerce platform focusing on mobile terminals? Aug 11, 2022 am 11:59 AM

The cross-border e-commerce platform focusing on mobile terminals is "Wish". Wish is a mobile cross-border retail e-commerce platform that mainly targets young people and low- and middle-income groups in developed countries. It provides users with product sharing and purchasing services through a wish list model. Its products include shoes, electronic products, kitchen gadgets, and home decoration. and other daily necessities. Wish belongs to the mobile APP shopping model. When users buy things on the APP, they will be pushed to products they have purchased and browsed before. This kind of intelligent recommendation is an application of Internet artificial intelligence, which is to recommend products that users care about and are interested in.

How to implement mobile map positioning function using Python and Baidu Map API How to implement mobile map positioning function using Python and Baidu Map API Jul 29, 2023 pm 11:33 PM

Method of implementing mobile map positioning function using Python and Baidu Map API. With the development of mobile Internet, map positioning function has become more and more common in mobile applications. Python, as a popular programming language, can also implement mobile map positioning functions by using Baidu Map API. The following will introduce the steps to implement the map positioning function using Python and Baidu Map API, and provide corresponding code examples. Step 1: Apply for Baidu Map API Key Before starting, we first need to apply

Using Vant in Vue to implement the mobile wizard introduction page effect Using Vant in Vue to implement the mobile wizard introduction page effect Jun 09, 2023 pm 04:10 PM

With the continuous development of the mobile Internet, more and more companies are beginning to use mobile platforms to display their products or services to users. When showing products or services to users, the wizard introduction page has become an important part of the display form. Vue.js is a popular JavaScript framework, and Vant is an excellent mobile component library based on Vue.js, which can help us quickly build mobile applications. This article will introduce how to use Vue.js and Vant to create a mobile wizard introduction

How to solve the problem of mobile gesture scaling pictures in Vue development How to solve the problem of mobile gesture scaling pictures in Vue development Jun 29, 2023 pm 12:48 PM

In mobile development, we often encounter the need to zoom in and out of images with gestures. For example, in Vue development, when users use finger pinch gestures on mobile devices, they hope to be able to zoom in or out of pictures. However, Vue itself does not have a built-in gesture zoom function, so we need to use third-party plug-ins or custom instructions to implement this function. This article will introduce several commonly used solutions. 1. Use third-party plug-ins. There are many useful third-party plug-ins on the market today, which can easily implement the gesture zoom function. Among the more commonly used plug-ins

See all articles