165,612 views
8 votes
8 votes
Using complete sentences post a detailed response to the following.

Instead of placing CSS code in a separate file, your friend places it in the same file as the HTML. Your teacher says that that is okay as long as it is surrounded by style tags. Which option do you think is better? Why?

User Jessie Dedecker
by
2.9k points

1 Answer

22 votes
22 votes

Answer:

Using an external style sheet is always better for readability and maintainability.

External style sheets can be referenced and reused by many different pages. A local <style> tag could be used on each .html document, but this would mean that any CSS changes made would need to be updated within each style tag, on each .html document. By putting it onto an external style sheet, you only need to update the CSS in one location for it to be used throughout the website.

User Polv
by
3.3k points