What benefits and demerits do External Style Sheets have?
Printable View
What benefits and demerits do External Style Sheets have?
Apply styles to a whole website by placing the CSS into an external stylesheet. An external style sheet is a separate file where you can declare all the styles that you want to use on your website. You then link to the external style sheet from all your HTML pages.
the only con that I can think of for external stylesheets is that it requires the browser to do an HTTP request to load the stylesheet, which would impact loading time, though, for production purposes, you are likely to just use one stylesheet file so it shouldn’t be too much.
The biggest advantage of a stylesheet is that it helps keeping the code clean and organized. It’s much more convenient to have the content in the HTML file, the styles in the CSS file, and the scripts in the JS file. If you need something, it’s much easier to find it in the appropriate file.
You should really only use inline CSS and the <style> tag if you need to play with specificity, as both of those are more specific than anything in external CSS file.