Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Responsive Layouts Media Queries Creating Breakpoints

Akashdeep Singh
Akashdeep Singh
1,249 Points

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
Jonathan Grieve
Treehouse Moderator 90,797 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! :-).