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 Pick Fonts and Set Relative Units

Variation of Font Style

Hi, if I choose only normal 400 for Open Sans and I do not include also the variation Normal 400 Italic, this means I can't format Italic my text using the font I choose (Open Sans in this example)? What Happens in this case:

In index.html file I include the font (only regular)

<link href="https://fonts.googleapis.com/css?family=Open+Sans:400" rel="stylesheet">

In CSS file I style Italic h1:

h1 { font-family: 'Open Sans', sans-serif; font-style: italic; }

Because I don' have included Open Sans Italic I will have sans-serif Italic?

I must had to font Open Sans Italic to have h1 Open Sans italic formatted: <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i" rel="stylesheet">

Thank You.

2 Answers

You'll get the browser's rendering of the font in bold.

Yes. You must use add whatever variation of the font you need. It's that way with every webfont provider. Example: With Typekit you load em all into kit an only the fonts and weight you added will be selectable.

But I have no clear what happens if I do not include for example Bold variation and I use it in my CSS code:

h1 { font-family: 'Open Sans', sans-serif; font-weight: bold; }

How is formatted h1?

Thank you.