Link styles correctly

1

I'm gradually digging into the web world, and today I noticed something unusual in my code, good, unusual more or less let's go to the examples.

In this code I use type="text / css"

<link rel="stylesheet" type="text/css" href="caminho aqui">

And in this I no longer use

<link rel="stylesheet" href="caminho aqui">

Both work, but is there a problem if I do not set the type? I need a very concrete answer that heals my doubt.

    
asked by anonymous 25.03.2016 / 19:47

1 answer

1

Nowadays it is no longer necessary to use the type attribute.

In version 4 of HTML was still referred to the attribute, but indicating that it "gives a suggestion" to the browser about the content, and by the text it is understood that it was not mandatory:

  

This attribute gives an advisory hint as to the content type of the content available at the link target address. [...] Authors who use this attribute ...

In HTML 5 specification is still clearer: / p>

  

The type attribute gives the MIME type of the linked resource. It is purely advisory.

The attribute is purely a suggestion (translating freely).

    
25.03.2016 / 19:59