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

Shloime Kahan
Shloime Kahan
4,943 Points

HTML fonts

I am not clear why this is added at the end of the font line

type="text/css"

Lukas Pscheidt
Lukas Pscheidt
2,229 Points

Indicates, that content is CSS.

1 Answer

When importing a font into HTML you are actually importing a CSS stylesheet which contains the content for that font. If you visit the link in the "href" portion of that font's HTML link tag you can see the styles declared in the imported file (for example, the "font-face" declaration which holds all of the necessary information for the font).

You add type="text/css" so that the browser knows the file being imported is a CSS file. This is no longer required for most, if not all, modern browsers or webpages utilizing HTML5.