5 ms·
> If your CSS reset doesn’t include this already, I’d suggest adding the following rule: ... If I'm trying to build a site design from scratch (rather than usi
by pansa2 6y ago
> If your CSS reset doesn’t include this already, I’d suggest adding the following rule: ...
If I'm trying to build a site design from scratch (rather than using Bootstrap or similar), is a CSS Reset a good place to start? Is there one in particular that's recommended?
- themodelplumber 6y agoIt can be a very helpful start, but I'd review to make sure you're learning from it as well, rather than building onto something that could set you up for confusion later if you end up working without it. Here's one that's popular, lightweight, and helpful in my experience: https://necolas.github.io/normalize.css/ https://necolas.github.io/normalize.css/
- mikewhy 6y agoDefinitely review multiple, because I find normalize.css to be pretty useless as it doesn't set `box-sizing: border-box;`, or `img { max-width: 100%; }`
- LocalPCGuy 6y agoI prefer a combination of reset/normalize, but because of that I agree with your statement re: learning from what you are using. Then you can make informed choices about how you are using those things.
- earthboundkid 6y agoYes. There are different philosophies for how to write CSS, but assuming you're aiming at something like BEM (Block, Element, Modifier) style, it's typical to start with a reset of the raw elements into a standard form, and then follow that with the CSS for you class components, and finally some !important override utilities. Basically all the CSS philosophies agree that you should never use #id selectors at all and use of element selectors should be (mostly) limited to resets.
- rimliu 6y agoIgnore all above is you are not keen to go the path of cargo-culting. Most of those philosophies were brought to you by people who were too lazy to learn CSS.
- LocalPCGuy 6y agoMost are from very respected people to help others benefit from their knowledge and to avoid the pitfalls they ran into a various levels of scale. Do you need BEM for a brochure-ware site, no, styling by IDs and tags would probably work just fine. But a web app with 1000s of lines of code, while I don't specifically endorse BEM, some sort of pattern and methodology will save you a world of pain in the long run.
- earthboundkid 6y agoIf you think BEM was created by people who don’t know CSS you may want to read https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect first.