With an external style sheet, you can change the look of an entire website by changing just one file! Inside the <link> element of each HTML page, include a reference (HREF) to the external style sheet file, as well as a definition of the relationship (REL) to the link and -- well, TYPE is self-explanatory. The <link> element goes inside the head section:
An external style sheet can be written in any text editor. The file should not contain any html tags. The style sheet file must be saved with a .css extension. Here is an idea of how a style sheet file, called "myStyle.css," might look like:
Do not add a space between the property value and the unit (such as margin-left: 20 px;). The correct way is: margin-left: 20px; |