This content originally appeared on DEV Community and was authored by Davisson
* {
margin: 0;
}
Browsers make common-sense assumptions around margin. For example, an h1 will include more margin by default than a paragraph.
These assumptions are reasonable within the context of a word-processing document, but they might not be accurate for a modern web application.
Margin is a tricky devil, and more often than not, I find myself wishing elements didn't have any by default. So I've decided to remove it all. 🔥
If/when I do want to add some margin to specific tags, I can do so in my custom project styles. The wildcard selector (*) has extremely low specificity, so it'll be easy to override this rule.
This content originally appeared on DEV Community and was authored by Davisson
Davisson | Sciencx (2023-06-06T20:17:51+00:00) Remove default margin. Retrieved from https://www.scien.cx/2023/06/06/remove-default-margin/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.