Lea Verou 24/06/2021

Inherit ancestor font-size, for fun and profit

Read Original

This CSS tutorial explains how to inherit font sizes from ancestor elements (like grandparents) rather than direct parents using type-relative units like 'em'. It covers real-world scenarios where this technique is necessary, including speech bubble components and working with <optgroup> elements in selects, providing solutions for maintaining scalable, DRY CSS code.

Inherit ancestor font-size, for fun and profit

commentaires

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet