Created
May 14, 2024 04:53
-
-
Save jamiemarsland/2cc05e0c3146629c2fcc9947acb0cfca to your computer and use it in GitHub Desktop.
Disable Negative Margins Globally on mobile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CSS to reset any negative margins on mobile devices */ | |
@media (max-width: 768px) { | |
* { | |
margin-top: 0 !important; | |
margin-right: 0 !important; | |
margin-bottom: 0 !important; | |
margin-left: 0 !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I agree, the code is quite "dangerous" to use as it messes up all margins on mobile devices. I suggest maybe updating the code to something like this: