Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I got bitten by this: user agent stylesheet contains "button {align-items: flex-start}" (at least in Chrome). The default behavior is "stretch". Spent an hour debugging why my flexboxs' sizes are wrong. I still want to use correct HTML elements as much as possible, but I do think using <div>s everywhere makes my small side projects so much easier, since I don't have to remember all the non-default behaviors.


I probably should have included "if you're building for the frontend you should probably know CSS". Good follow-up piece. Thanks for mentioning it!


`appearance: none` goes a long way to resetting button styles. I usually make a .unbuttonify class to use or extend for things I want to behave like buttons (free focus, accessibility, and interactivity) but look like, say, a hamburger menu toggle.


are css resets not in vogue any more? I still use them for all my side projects. As well as a normalize.css[0] that smooths over any additional browser inconsistencies. The original Meyer reset is definitely overkill, but there are a couple newer more minimal ones out there[2][3]

[0] https://necolas.github.io/normalize.css/

[1] https://meyerweb.com/eric/tools/css/reset/

[2] https://www.joshwcomeau.com/css/custom-css-reset/

[3] https://piccalil.li/blog/a-more-modern-css-reset/


Less so now that the `all: unset` property is getting better support.

https://developer.mozilla.org/en-US/docs/Web/CSS/unset




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: