Things You'll Need:
- Computer with Internet access
- HTML editor software
- Web browser
-
Step 1
Open an HTML editor or Notepad software program. Create a new text document with a .css extension. Name the file, "style.css" and save it. This file is the external style sheet.
-
Step 2
Open the web page or pages where you want to apply the style sheet. Link the web pages to the cascading style sheet. Put the following "link" tag between the "head" tags of the web page such as:
-
Step 3
Define the styles for various elements of a web page. Cascading style sheets use a three part syntax: a selector, property and value. The following style code defines styles for the body, headers and paragraph in a web page.
body {background-color: blue}
h1 {font-size: 30pt}
h2 {color: black}
p {margin-left: 40px} -
Step 4
Copy and paste the style code you created into the style.css file and save it.
-
Step 5
Upload the style.css file and the web pages that are linked to the css file to the web server. Make sure these files are in the same directory.
-
Step 6
Open a web browser and load the linked web page or pages to test the style sheet. If the pages are linked properly, the defined styles in the external style sheet display in the web pages.






