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

Rodrigo Teixeira
Rodrigo Teixeira
1,417 Points

Is link type attribute opitional?

I noticed that when google fonts were linked to the html document, besides the standard attributes such as rel and href, there was also a type attribute that hasn't been used before when linking main and normalize sheets. I checked it out on the internet and many main css files are linked using the type attribute as well. Which led me to the following questions: is it optional? What is the difference between writing it or not? Thank you.

1 Answer

Meg Matty
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Meg Matty
Front End Web Development Techdegree Graduate 22,928 Points

From googling around and looking at HTML5 specs and MDN, it would appear that the type attribute on link tags is "purely advisory" and may not necessarily break anything if not included. "Advisory" seems to mean it's just good practice to inform readers of your code what type is being linked.