What is the best practice performance-wise for adding styles to sections?
<style>
.foo {
[...]
}
</style>
<div >
[...]
</div>
or
<link rel="stylesheet" href="foo.css">
<div >
[...]
</div>
Does the best practice differ for general styles included in head vs sections?
CodePudding user response:
In terms of performance, inline CSS is faster as it only requires the browser to download 1 file while using external CSS will require downloading HTML and CSS files separately.
CodePudding user response:
** best practice **
<link rel="stylesheet" href="style.css">