Why do people keep using text / css?

I read several Google search results, for example, this good question: Is type = "text / css" necessary in the <link> tag? . However, I am currently viewing css3 code (this is not the new one), and I see text/css everywhere.

Has something changed, or is it just an old habit that we (young people) should not inherit?

+6
source share
5 answers

Nothing has changed, it is used for backward compatibility and is likely to appear more rarely over time, since a more installed browser will support HTML5.

+6
source

text / css is NOT required in HTML5, however the WC3 specification mentions it, so it is recommended to use it in any CSS import statement. They will work without the specification defining the correct behavior in the absence of "text / css" - but I will not depend on all old (or future) browsers that handle the missing property in the same way. Therefore, it is just good practice to include it.

+3
source

If you refer to this question , it seems that the HTML5 specification says this attribute is advisory (it says the look is here ).

The type attribute indicates the MIME type of the associated resource. This is purely advisory. The value must be a valid MIME type.

For external resource references, the type attribute is used as a hint to user agents so that they can avoid getting resources that they do not support. If the attribute is present, then the user agent must assume that the resource is of the given type (even if it is not a valid MIME type, for example, an empty string). If the attribute is omitted, but the link type of the external resource has a specific type by default, then the user agent must assume that the resource has this type. [...] If the attribute is omitted, and the link type of the external resource does not have a specific type by default, but the user agent will receive the resource, if this type was known and supported, then the user agent should receive the resource under the assumption that it will be supported.

So you can specify it, but it is not necessary.

+3
source

As soon as I received a client with a strange Frontend error. In the end, he received a proxy (I really don't know how this works), which did not allow resources without text/css .

Was in 2014 in a big company.

Perhaps he was unique, he no longer encountered the same problem!

+2
source

"Has something changed, or is it just an old habit that we (young people) should not inherit?" - Yes, do not use.
Of the type html 4, it is not required in <link> , it was something added for possible future functionality that never comes. As a new way to style elements, why you should specify text/css .
But, as I said, you should not use it, because it is useless.

+2
source

All Articles