Cascading Style Sheets (also known as CSS or style sheets) are an excellent way to control the design of your website. The one drawback is the excess code they can add to your website. This can be overcome by adding all your CSS code to an external file and linking it to your website. This process is similar to how images are used on a webpage. As you know, the image file is not located in the HTML file; instead, the HTML code tells the browser where to look for the file. This means the code tells the browser there is an image that needs to fill the allotted area, and that it can be found at a certain location. This is the same for external CSS files. The code tells the browser it needs to follow a set of directions, and that those directions can be found in a file located at a certain location. Another advantage to using external CSS is the ability to use the external file with several different pages.
An example of the code used for linking an external CSS file is below. The external CSS file in this example is called style.css.
<head> <link rel="stylesheet" type="text/css" href="style.css" /> </head>
As you can see, the link is placed between the <head> </head> tags of your HTML file.
Note: The external CSS file should not contain any HTML tags.