Hiding columns on small screens in Bootstrap 4
See original GitHub issueHiding columns on small screens is hard and inconsistent in Bootstrap 4 compared to Bootstrap 3 because 1) you have to use “d-" classes and 2) mix them with "col-” classes.
In Bootstrap 3, I could do like this (verbose example):
<div class="row">
<div class="hidden-xs col-sm-6 col-md-6 col-lg-6">
Hide me on small screens
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
Only show me on small screens
</div>
</div>
As I understand, the .hidden-* classes were removed because they conflicted with jQuery’s $(...).hide() and $(...).show() methods.
To overcome this, I suggest a new grid column that is easier to comprehend and does not conflict with jQuery:
- .col-xs-0 (same as .hidden-xs in BS3)
- .col-sm-0
- .col-md-0
- .col-lg-0
- .col-sm-0
So I can do:
<div class="row">
<div class="col-xs-0 col-sm-6">
HIDE ME ON SMALL SCREENS.
Show me on larger screens.
</div>
<div class="col-xs-12 col-sm-6">
SHOW ME ON SMALL SCREENS.
Show me on larger screens.
</div>
</div>
See also:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Hide a column on smaller screens for Bootstrap 4 [duplicate]
1 Answer 1 · I was at: getbootstrap.com/docs/4.0/utilities/display and could not make heads or tails of it. Your solution seems to work fine....
Read more >Display property - Bootstrap
To hide elements simply use the .d-none class or one of the .d-{sm,md,lg,xl}-none classes for any responsive screen variation. To show an element...
Read more >How do you hide columns on small screens using Bootstrap 3?
Hiding an element can be done by setting the display property to none. The element will be hidden, and the page will be...
Read more >HTML : Hide column on smaller screens only with Bootstrap 4
HTML : Hide column on smaller screens only with Bootstrap 4 [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] HTML ...
Read more >How to hide element on small devices in Twitter Bootstrap
Just target the desired element. · Apply the class “d-sm-none” · For visualization, it is depicted below the two instances – before applying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So, to answer the question, we have to do:
Don’t hesitate to tell me if I’m wrong
Hello, It’s working for me but there is another issue. The issue is when using the
d-nonethe width ofrowis reduced. I am using classes like,d-none d-sm-block col-md-4