External CSS

W3 Schools Reference Page

CSS Home

Extracting our CSS selectors to a separate file allows us to share styles between multiple HTML pages. This further helps us keep our code D-R-Y (don't repeat yourself) and avoid code rot.

Look at the source for this page and see how the <style> tag has been replaced with a <link> tag.

This paragraph (and the previous three) is styled by the class selector in the linked CSS file.

This paragraph is styled by the id selector in the linked CSS file. It has a maximum height and you need to scroll down in order to read all of the text.