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

The margin between a text and an element

How do we start calculating the space under or above the text, Typeography Is it from the ascender/descender or from the cap height / baseline ? Guil Hernandez

But i made a markup to be sure, Typography i've reset the CSS, then it shows like it start from the ascender up and decender down. James Barnett

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Mostafa Syam,

I thought you were referring to line height in lines of text, which would look something like this:

With headings or blocks of text, then yes, if you add margins or a bg color (as you did), it will affect the entire element's "box."

2 Answers

I think it's from baseline down and from x height up

I think it's from baseline down and from x height up