Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between type="text/css" and type="text/stylesheet"?

More out of general interest more than anything, but what's the difference between

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

and

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

There appear to be some differences to the style in different browsers, but I can't really point to anything specific - is there any real difference between using either of these?

like image 644
edparry Avatar asked Sep 17 '12 10:09

edparry


People also ask

What does the style type text CSS mean?

Definition and Usage The type attribute specifies the Internet media type (formerly known as MIME type) of the <style> tag. The type attribute identifies the content between the <style> and </style> tags. The default value is "text/css", which indicates that the content is CSS.

Is type text CSS necessary?

It's not required with the HTML5 spec, but for older versions of HTML is it required. Type stands for The MIME type of the style sheet.


Video Answer


1 Answers

text/stylesheet is not a valid type for the link element.

You should use text/css.

You are probably seeing a difference in browsers because some browsers have taken into account people might incorrectly use type="text/stylesheet" instead of type="text/css".

like image 104
Curtis Avatar answered Sep 21 '22 15:09

Curtis