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 CSS Foundations Values and Units Relative Length Units

Matthew Thomas
Matthew Thomas
3,127 Points

using "rem"

h1 { font-size:2.5em;

}

p { font-size:1.5em; }

.more a { font-size:1.2rem; }

what am i doing wrong here?

3 Answers

Matthew Thomas
Matthew Thomas
3,127 Points

….thanks - had the <a> element in the wrong place, duhh :(

Dillon Patel
Dillon Patel
4,025 Points

The rem unit stands for root-em. Root-em will be a multiplier in regards to the root element which is normally the HTML element. The default font-size is normally 16 px (or 1 em).

When using the em unit, you avoid the 'compounding effect'. The compounding effect with multiply on top of the already adjusted font-size.

Let me know what you're trying to do and hopefully I can help you out!

Jon Edwards
Jon Edwards
7,913 Points

This article really makes it make sense: (about em units and rem units)

http://www.impressivewebs.com/understanding-em-units-css/

Also, CSS Tricks has a good article, read the comments!

http://css-tricks.com/why-ems/