[Grid] `.stackable` and regular grids have inconsistent margins on mobile screens
See original GitHub issueGrid and stackable grids don’t seems to have the same behavior on small screens:
@media only screen and (max-width: 767px) {
.ui.grid {
margin-left: -1rem !important;
margin-right: -1rem !important;
}
.ui.stackable.grid {
margin-left: 0rem !important;
margin-right: 0rem !important;
}
}
To mix .ui.grid
and .ui.stackable.grid
on the same page I have to fix this in grid.overrides
:
@media only screen and (max-width: 767px) {
.ui.grid {
margin-left: 0rem !important;
margin-right: 0rem !important;
}
}
Have I missed something?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
CSS grid not displaying correctly on actual mobile browsers ...
You use grid-gap . grid-gap has been deprecated in favor of gap . The gap CSS property sets the gaps (gutters) between rows...
Read more >Everything you need to know about spacing & layout grids
Margins are the negative space between the edge of the outside column and the frame. There are many ways to combine columns, gutters,...
Read more >Why Bootstrap's grid gutters in the middle are twice as large ...
The reason for the inconsistency is that the grid columns extend to the edge of the container, and the containers margin (or padding)...
Read more >CSS Grid Gotchas And Stumbling Blocks - Smashing Magazine
The first layout uses flexbox to display as many boxes as will fit into the available width. Here we are controlling the layout...
Read more >Stackable – Page Builder Gutenberg Blocks – WordPress plugin
Feature Grid Display multiple product features or services. You can use Feature Grids one after another. Notification Show a notice to your readers....
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 FreeTop 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
Top GitHub Comments
You’re not missing anything, I keep bumping into this one too. I ended up with the following fix, similar to yours:
It’s far from ideal, because it requires a custom
.nested
class to be assigned to all nested grids. I’m running into problems now because that class is not present in some scenarios, so I’m looking for a better fix.Also, adding
.relaxed
classes to the affected grids will probably mess with this fix.This issue seems to be related too: #4129
Hi, I have the same issue here, negative margin on mobile cause my layout to be scrollable even if there is nothing to scroll … 🐛
EDIT : it’s seems that if you add an
<div class="ui container">
around the negative margin grid solve the issue. The scroll isn’t there anymore, but the negative margin does