A question about "type"

In this code snippet, what indicates type=“text/css”?

<link href="https://fonts.google.com/share?selection.family=Lobster" rel="stylesheet" type="text/css">

Challenge: Import a Google Font

Link to the challenge:

According to MDN Docs,

This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html , text/css , and so on. The common use of this attribute is to define the type of stylesheet being referenced (such as text/css ), but given that CSS is the only stylesheet language used on the web, not only is it possible to omit the type attribute, but is actually now recommended practice. It is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports.

There is also an article about MIME types

1 Like

Oh, I see. Thank you

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.