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

HTML How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

When creating a website, what would be a good rule of thumb to add em or % vs pixels into a website.

When creating a website, what would be a good rule of thumb to add em or % vs pixels into a website.

2 Answers

Byron Stine
Byron Stine
4,877 Points

For text and pictures size and positions for sure use ems or percentages for accessibility reasons. Divs and containers I use percentages because it makes it easier to do math when dividing up column layouts. Pixels I use for styling box-shadows, padding, borders, etc. If you are comfortable using HTML and CSS, I recommend to view the course on Responsive Layouts specifically with media queries using CSS.

Most modern designs use em, rem, and %. I would focus on those.