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 Responsive Layouts Media Queries Creating Breakpoints

I am getting confused on using percentages or ems for relative measurements

How should I determine the exact percentage value for width or ems for font sizes? Or does it need experimentation with the content

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

As I understand it the calculation is target divided context where the target is the width of the element you want to make responsive and the target is the size of the parent element.

You then round the result into a percentage value of 2 decimal places e.g. 22.34% or more so you're left with a responsive element which is an element with a relative unit! :-).

any more examples