FAQ: CSS Typography - Letter Spacing

This community-built FAQ covers the “Letter Spacing” exercise from the lesson “CSS Typography”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn CSS

FAQs on the exercise Letter Spacing

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

what is the default value for the kerning spacing??

5 Likes

You’ve learned how to increase the spacing between lines of text and words

The last lesson was word-spacing. Is line spacing something to do with padding and display: inline?

Ah, it seems to be later, in Line Height Anatomy. The sections must have been reordered at some point.

I have noticed that letter-spacing also gives the same amount of space after the last letter of the text. Is there an efficient way to stop this or compensate for it?

If you use it only on headings then it is not an issue since headings do not end with a full stop and typically have no punctuation. In paragraphs we should not mess with letter spacing.

1 Like

so if the word-spacing's default value is .25 em (25% of the font-size) , what is the default em for letter-spacing ?

The default is normal, but what that equates to in ems is difficult to say. In 16px font size the spacing may be about 1px, so, 1/16 em, or 0.0625em.

2 Likes

thank you for making it clear!

1 Like

CSS Typography lesson has some examples when we use ‘em’ for a unit. As i understood, the difference between ‘em’ and ‘pixel’ is that ‘em’ is a relative unit while a ‘pixel’ is an absolute unit.

Could anyone give some examples when we should use ‘em’ rather than ‘pixel’ in practice?

Even if you shouldn’t mess with the letter-spacing property of <p> elements, you can fix the problem @thesethneal mentioned by wrapping the last word in a <span> element and adjusting this <span>'s letter-spacing property

I recommend always using relative units when sizing text. This can either be em or (the preffered one) rem

This means that if the user changes the default font-size on his browser settings, the text on our web page will actually adapt to these preferences. Here is a helpful article I read about this topic: https://medium.com/code-better/css-units-for-font-size-px-em-rem-79f7e592bb97

As this post mentions, the value assigned to the word-spacing property will actually get added to the default value instead of it being the final value. This means that if we assign 0.5em to the word-spacing property of an element, it will actually have 0.75em of word spacing as 0.25em (the default word spacing) + 0.5em = 0.75em. The same thing applies with letter spacing

1 Like