I'm trying to use Google Web Fonts, and on the official site it recommends using a <link>
tag including the type
attribute, as following:
<link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700' rel='stylesheet' type='text/css'>`
In the official HTML5 boilerplate site they ommit the type
attribute
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700">
According to this rather old answer, in HTML5 the type
attribute is optional on the <style>
tag and mandatory on the <link>
tag.
However, the version without the type
attribule validates fine on the W3C validator.
So, is the type
attribute mandatory or not?
I think it is not mandatory, I have successfully used
<style>
and also<style type="text/css">
.. Anything u use will be working such as<script>
and<script type="text/javascript"
> work the same way :)I found the answer on the official W3C HTML5 draft:
For the
<style>
attribute, the same document states: