Optimizing scripts and links
ProblemYou want to reference JavaScript and include links to external CSS files in your web page as simply as possible.
Solution
Include script and link declarations, but without the type attribute:
<link rel="stylesheet" href="styles.css" />
<script src="scripts.js"></script>
Discussion
HTML5 requires only the minimum amount of information needed for user agents. In previous versions of HTML, both CSS links and script required the type attribute to indicate the language. If you forgot to include type, though, most browsers assumed the correct value.
Makes sense, since there is really only one standard scripting language and only one styling language for the web right now. HTML5 makes type officially optional, but still validates older documents that do include the attribute.
Makes sense, since there is really only one standard scripting language and only one styling language for the web right now. HTML5 makes type officially optional, but still validates older documents that do include the attribute.
No comments:
Post a Comment