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!

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 Basics (2014) Understanding Values and Units Line Height

Alex Galata
Alex Galata
3,233 Points


Please tell me, what is units and how it relate to px or percentage? How can I define what number of unit I need to use? Thank you

Hello Alex,

Units specify a length: relative to another length property (relative length units) or fixed (absolute length units). Focus on px (aboslute) em and % (relative). There are the most commonly used when you begin.

Please check w3schools webistes: http://www.w3schools.com/cssref/css_units.asp - theory http://www.w3schools.com/cssref/css_pxtoemconversion.asp - converter

Good luck!

Alex Galata
Alex Galata
3,233 Points

A lot of thanks Michal.

1 Answer

the percentage is of what percent if the page is to be used and px stands for pixels, the tiny squares that make up a computer screen, to it depends on how big you want it.