Disallow usage of <style>
tag
- Rule ID:
- no-style-tag
- Category:
- Style
- Standards:
- -
The <style>
tag can be used to write CSS directly inside the document. When
using multiple documents it is preferable to put all styling in a single asset
and use the <link>
tag to reference it to lower the bandwidth required (by
preventing duplicated style across all page loads).
Rule details
Examples of incorrect code for this rule:
<style>
body {
background-color: hotpink;
}
</style>
Examples of correct code for this rule:
<link rel="stylesheet" src="my-style.css">