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

HTML How to Make a Website Customizing Colors and Fonts Resize Text

Julianna Kahn
Julianna Kahn
20,702 Points

In my opinion, the font I selected is great for h1 but a little heavy for h2. My question is about a lighter weight font

My text editor suggests a font-weight value called "lighter". It seems to look fine. Is there any reason I wouldn't want to use it?

Also curious, the font I selected does not show an extra-bold variation. Does that mean I would have to choose a different font?

3 Answers

rydavim
rydavim
18,813 Points

font-weight: lighter; will do just what you expect, you'll get a thinner version of the font than normal weight. If you like the look better, go for it!

In terms of font-weight, the weights available are dependent on the font you've selected. Some fonts have lighter and bolder weights, some do not. For example - Roboto has twelve different styles, whereas Lexend Deca only has one.

Let me know if you have any follow up questions, and happy coding!

Julianna Kahn
Julianna Kahn
20,702 Points

Lighter does give the look I want but it is not an available option with the font I downloaded. I was just wondering if there were any resolution/quality issues using a font weight that is not part of the fonts that were downloaded. Thanks.

rydavim
rydavim
18,813 Points

It's really going to depend on the font. There are variable fonts which allow a high degree of control, and support a range of weights. I'm not sure if the one you're using falls into that category or not.

I would take a look at the MDN page about font-weights and see if that helps.

Julianna Kahn
Julianna Kahn
20,702 Points

The font I downloaded is PT Sans. How would I know if it is a "variable" font?