little known CSS facts

This blew my mind today:

Please make sure to check browser support for CSS features on Can I Use Show archive.org snapshot and the Mozilla Development Network Show archive.org snapshot before using.

Favorites

  • outline-offset: specify how far away from the element an outline is rendered
  • ::first-letter: matches the first letter inside an element
  • Using Unicode letters as css classes, e.g.
  • font-weight: relative keywords bolder and lighter, which will render a font in "inherited font-weight +/- 100"
Henning Koch Over 8 years ago