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
MOD
Jonathan Grieve
Treehouse Moderator 87,403 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! :-).