[css] Do we need type="text/css" for <link> in HTML5

Possible Duplicate:
Is type=“text/css” necessary in a <link> tag?

Do we need type="text/css" for <link> tag in HTML5?

This question is related to css html

The answer is


For LINK elements the content-type is determined in the HTTP-response so the type attribute is superfluous. This is OK for all browsers.


You don't really need it today, because the current standard makes it optional -- and every useful browser currently assumes that a style sheet is CSS, even in versions of HTML that considered the attribute "required".

With HTML being a "living standard" now, though -- and thus subject to change -- you can only guarantee so much. And there's no new DTD that you can point to and say the page was written for that version of HTML, and no reliable way even to say "HTML as of such-and-such a date". For forward-compatibility reasons, in my opinion, you should specify the type.


Don’t need to specify a type value of “text/css”

Every time you link to a CSS file:

<link rel="stylesheet" type="text/css" href="file.css">

You can simply write:

<link rel="stylesheet" href="file.css">