Bootstrap 4: Concealed and Revealed Columns?

Is anyone else experiencing an issue where xs is hidden in xs views? I have a hunch it might be due to changes in Bootstrap v4, but I'm curious if there's a way to still make it work without delving into the CSS. My current setup uses the default bootstrap.css file.

<div class="container">
    <div class="row">
    <div class="hidden-xs col-lg-4 col-md-6 col-sm-12 col-xs-12">
    Some text here.
    </div>
</div>

Answer №1

Sharing this response to address the issue of lengthy comments in the accepted answer and its incompleteness. Within Bootstrap 4 beta, it's important to note that the hidden-* classes no longer have a presence.

"What does hidden-sm-DOWN mean?"

In previous versions, "hidden-sm-DOWN" implied being hidden on small screens and below (on xs and sm breakpoints), while remaining visible otherwise. However, in Bootstrap 4 beta, these classes are no longer used.

To achieve element visibility control based on specific breakpoints in Bootstrap 4, utilize the d-* display classes accordingly. Keep in mind that xs is always implied unless altered by a larger breakpoint. With the default xs, there's no need for the -xs- infix – use d-none instead of d-xs-none.

Visit this link for an example

  • hidden-xs-down translates to d-none d-sm-block
  • hidden-sm-down converts to d-none d-md-block
  • hidden-md-down changes to d-none d-lg-block
  • hidden-lg-down becomes d-none d-xl-block
  • hidden-xl-down equals d-none (similar to hidden)
  • hidden-xs-up equals d-none (same as hidden)
  • hidden-sm-up transforms into d-sm-none
  • hidden-md-up turns into d-md-none
  • hidden-lg-up shifts to d-lg-none
  • hidden-xl-up corresponds to d-xl-none
  • hidden-xs exclusively equates to d-none d-sm-block (similar to hidden-xs-down)
  • hidden-sm solely represents d-block d-sm-none d-md-block
  • hidden-md only signifies d-block d-md-none d-lg-block
  • hidden-lg specifically denotes d-block d-lg-none d-xl-block
  • hidden-xl solely implies d-block d-xl-none
  • visible-xs indicates d-block d-sm-none
  • visible-sm shows d-none d-sm-block d-md-none
  • visible-md displays d-none d-md-block d-lg-none
  • visible-lg exhibits d-none d-lg-block d-xl-none
  • visible-xl reveals d-none d-xl-block

Preview all hidden / visible classes in Bootstrap 4 beta here

Note that d-*-block can be interchanged with d-*-inline, d-*-flex, etc., depending on the element's desired display type. For more details, check out the beta display classes


Additional resources:
Troubleshooting Bootstrap 4 hidden-X-(down/up) class issues
Locating missing visible-** and hidden-** functionalities in Bootstrap v4

Answer №2

UPDATE The hidden-* properties have been removed in the latest Bootstrap beta 4 version.

You should now utilize the d-*-none classes (*= xl, sm, md, lg). Check out this link for more information.

Here's an example:

The class d-none will hide an element on all screen sizes.

The class d-sm-none will hide an element on small devices.

The class d-md-none will hide an element on medium devices.

The class d-lg-none will hide an element on large screen devices.

To implement this, follow these steps:

<div class="container">
    <div class="row">
    <div class="d-none d-sm-none d-md-block col-lg-4 col-md-6 col-sm-12 col-xs-12">
        Insert your content here.
    </div>
</div>

Start with d-none and add the specific screen size using d-*-block. For instance, to display only on medium devices (md), use class="d-none d-md-block".

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Height CSS does not conceal side bar hyperlinks

CSS .nested-menu { .list-group-item { cursor: pointer; } .nested { list-style-type: none; } ul.submenu { height: 0; } & .expand { ul.submenu { ...

Utilize Z-index to hide elements from view

Encountering an issue with hiding other div elements when one is visible. In the code snippet below, I aim to make Pacific Rim and World War Z disappear using z-index when Star Trek is visible. Here's my HTML code: <!doctype html> <html ...

Linking a Wordpress submenu to a specific section of a page

I am utilizing a Wordpress menu to act as the primary navigation for my website. Each main item in this menu is a Page Type that redirects to other existing pages, with one of them containing submenus made up of custom links. These custom links' URLs ...

Steps for inserting a button within a table

Currently, I have implemented a function that dynamically adds the appropriate number of cells to the bottom of my table when a button is clicked. This is the JavaScript code for adding a row: <a href="javascript:myFunction();" title="addRow" class= ...

The responsive menu refuses to appear

my code is located below Link to my CodePen project I'm specifically focusing on the mobile view of the website. Please resize your screen until you see the layout that I'm referring to. I suspect there might be an issue with my JavaScript cod ...

Is it possible for a relative div to automatically adjust its height when the height of the inner absolute div increases?

I am working with the following HTML code snippet: <div id="content"> <div id="leftcol"> <p>Lorem Ipsum</p> </div> </div> along with this CSS styling: #content { width: 780px; padding: 10px; position: relative; back ...

Enhancing ng-grid with pagination by incorporating diverse images

I am currently working with a grid that displays images as values in one of its columns using the code below. { field: 'TR', displayName: 'Trigger Redundancy', cellTemplate: '<div class="ngCellText" ng-class="col.co ...

I am encountering challenges and confusion with CSS

I am encountering an issue with my code that is causing some difficulties. The goal is to create a basic div with left, right, and center panes. The left pane loads perfectly, but the right pane, which has the same css styling, displays its children with a ...

Tips for adjusting the horizontal position of a grid item within a map() loop

I am trying to align the text in my Timeline component from Material Ui always towards the center of the timeline. The TimelineContent contains Paper, Typography (for title and description), and an image. Currently, I have multiple TimelineContent element ...

Tips for disabling autofocus on textarea when it is initially created in Internet Explorer browser

By clicking a button, I can generate a new <textarea></textarea>. However, in Internet Explorer, the cursor automatically moves to the newly created text area. Is there a way to prevent this from happening? ...

fixed divs that remain in place while scrolling

In the past, I have implemented a method similar to this: However, I am not a fan of the "flicker" effect that occurs when the page is scrolled and the div needs to move along with it. Recently, I have come across websites where certain elements (such as ...

What is the best way to define file paths in a webpage to ensure that the same file works seamlessly on both server and

Currently, I am working on developing a website locally with the intention of later transferring it via FTP to my server. In my index.php file, there is a line that reads: <?php include($_SERVER['DOCUMENT_ROOT'] . "/includes/header.php");?&g ...

Is it possible to implement Photoshop-inspired color curves filters on an HTML tag?

I am attempting to recreate the color curves filter from Photoshop using an HTML video tag. https://i.stack.imgur.com/erB1C.png The solution closest to what I need so far is how to simulate Photoshop's RGB levels with CSS and SVG Filters, but it doe ...

The animation of a disappearing div with CSS is not stopping when hovering over it

Hello, I've been working on a snackbar feature that appears and disappears on a set timer but also needs to pause when hovered over. Unfortunately, the current setup with setTimeout and useState is causing issues with this functionality. I have looke ...

conceal the offspring from the guardians, not the offspring

Could you please assist me with this situation... <li id="4331">Region <ul> <li id="4332">Asia</li> <li id="6621">Europe</li> </ul> </li> I have a query when I click on the Reg ...

Is storing text in data-content and utilizing bootstrap-popover.js compatible?

Is it possible to display HTML content in a popover using ? How reliable is it to store text in data-content? Can we expect it to function properly across all browsers? ...

Shift the checkbox label over to the left with just CSS

I am faced with the following code snippet: <div> <span> <input type="checkbox"> <label>I desire this to appear on the left-hand side</label> </span> </div> My goal is to shift the label to the left side of ...

Tips for shortening extra text in a non-wrapping HTML table cell and adding "..." at the end

My HTML template includes text imported from a database field into a <td> tag. The length of the text can range from 3 to 200 characters, and the <td> spans 100% of the screen width. If the text surpasses the width of the screen, I want it to b ...

Experiencing challenges during the creation of a NUXT build

Trying to build a Nuxt SSR app, but encountering an error related to the css-loader during the build command execution. The issue seems to be with Invalid options object. ERROR in ./node_modules/vue2-google-maps/dist/components/streetViewPanorama.vue (./no ...

Validating SASS based on class name

Hi there, I am fairly new to SASS and do not consider myself a programming expert. I have ten aside elements that each need different background colors depending on their class name. Even after going through the SASS documentation, I am still unable to f ...