Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Design Web Typography Final Project: Create a Typographic Site Header and Summary

pat barosy
pat barosy
6,759 Points

2 different values for padding in header and summary

Hello all,

Can anyone explain why Mattox uses both em & percentage values for the padding selector in header and summary classes?

1 Answer

Caroline Forslund
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Caroline Forslund
Front End Web Development Techdegree Graduate 36,096 Points

Because you want more exact padding for the top and bottom while you want more fluid padding on the sides. The em value will be a fixed value dependant on the font size it's inheriting it from. The percentage will mean less padding on the sides the more narrow the view is. Hope that makes sense.

To learn more about em values you can watch this video: https://teamtreehouse.com/library/em-units