logoalt Hacker News

spartanatreyutoday at 1:04 AM2 repliesview on HN

> I always tell myself that I should use backwards-compatible CSS only. > > I vividly remember IE and many hacks to have css elements properly working in it…

The common advice now is to only use CSS that is supported in the last two major versions of each major browser. You can check any css property's support here: https://caniuse.com/

> Imho this is a reason why markdown and other rich-textual formats appeared.

Markdown is a superset of html and through it contains css through the style element

> Btw is there a some “w3schools” for recent CSS?

CSS is constantly changing, I'd recommend the following for how to apply new CSS features:

- https://www.youtube.com/@KevinPowell

- https://ishadeed.com

- https://www.joshwcomeau.com

MDN is the best technical reference: https://developer.mozilla.org/en-US/

- You can search any css property in there and it will return all the rulesets for that property.

To see how people are using CSS, I'd recommend:

- https://codepen.io/

- Mastodon/fediverse

  - Reason: All other social networks only have webdevs who sip the coolaid of whatever trend is happening at the moment, they're not actually interested in learning what CSS can do. However, the web devs in the fediverse are actually interested in what CSS can do.
To see future CSS:

- You can see the proposals here: https://github.com/w3c/csswg-drafts/issues

- Proposals often require experiments which you can find on mastodon/fediverse. For example: https://front-end.social/@kizu

There's also the yearly State of CSS survey to get an overall sense of it: https://2026.stateofcss.com/en-US/


Replies

alwillistoday at 4:47 AM

> The common advice now is to only use CSS that is supported in the last two major versions of each major browser.

There's a much easier way—Baseline: https://web.dev/baseline

CSS features that have been available for 30 months for Chrome, Edge, Firefox and Safari are "Widely Available" and are safe to use.

Commonly used tools like Browserslist and Stylelint support checking for Baseline compliance.

binaryturtletoday at 7:22 AM

> The common advice now is to only use CSS that is supported in the last two major versions of each major browser.

Browsers seem to release a major new version like every 2 weeks now. So this statement does no longer hold true. You'll have a lot of users with broken results, if you follow that advise (everyone who uses a ESR or is otherwise limited with updates and behind a month)

I'd say for safety one should target the browsers of the last 4 years at least. You easily can write new CSS —or Javascript— and then use a conversion during deployment to target the lower standards. That's more important for Javascript than for CSS though. If only half of the sites would deploy with `babel` and with some compatibility in mind 80% less of the web would be broken for users with older browsers.