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

CSS CSS Layout Techniques Grid Layout Testing our Grid

Why are the padding-left and padding-right is in fixed pixels instead of relative values like em and %?

THis is for making the grid responsive. I see that everything else is in percentages but not the paddings for the container. Why is that?

Alexander Costa
Alexander Costa
11,464 Points

Sometimes when coding in CSS you want to have greater control over things. I switch between px, em, and % all the time. I usually use px to fine tune where things are placed.

1 Answer

To my opinion it’s read throughout every browser engine the same way and thus makes it more precise in having it look similar across multiple browsers.