Using Cascading Style Sheets and Inline Styles So far, you have formatted the content in your webpages using individual HTML tags that tell the browser how to format it. You have centered text and changed its color to red. As you work in a website, you will learn to create specific styles for different elements, making sure they are formatted in the same way. A cascading style sheet (CSS) is a file ending with the extension .css; this extension contains all the formatting instructions used in a particular website. Using a CSS allows a developer to separate the content of a site from its formatting instructions by placing the instructions for the entire website in a single CSS file. By changing the instructions for how elements are formatted in the CSS, you are also changing all webpages that use the CSS. A CSS can include instructions for formatting fonts, colors, and page layout. As you might expect, the CSS is a complex document of coded information that must adhere to syntax rules for HTML documents. sidenote Tip: Coding a CSS requires programming experience and is beyond the scope of this book. CSS supplies a complex set of formatting instructions to a website, but you can still use styles in basic HTML documents. You already used an inline style to change the appearance of content formatted with the h2 tag when you changed it to centered and its font color to red. You can also create an internal style sheet, which creates a set of formatting instructions that affect the tags in a single HTML document. For example, instead of coding each h2 tag so that it is centered and uses a red font, you can create an internal style sheet for the h2 tag to supply these instructions so that every h2 element in the HTML document will be formatted using the instructions provide in the internal style sheet. Internal style sheets are coded in the head section of the HTML document. Next, you will change the inline style you created for the h2 tag to an internal style sheet that produces the same formatting. To use an internal style sheet: 1 Switch to your text editor. 2 Click the insertion point to the right of the closing tag, and then press the Enter key twice. 3 Type the following code, pressing the Enter key after typing the
    Creates a bulleted list
    • Item 1
    • Item 2
    In this session, you learned how to create an HTML document and view it in a browser. The HTML document that you created is very simple; if you are interested in learning more about HTML and XHTML, you can take a separate class on HTML or website design to further your studies. In the next session, you will learn how to plan and prepare to publish a website.