TODAY I LEARNED

Center a focal point using CSS

You can crop images so they center a focal point in a responsive way using object-position with calculated values!

Special thanks to: https://johannesodland.github.io/2023/02/26/cropping-images-with-css-while-keeping-a-focal-point-in-the-center.html

Tweet

Learned by kevin-perez on Jan 6, 2025

Discover our latest blog posts
  • #html-css
  • view raw
  • permalink
  • 1 likes
previous TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter