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 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/