Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 12. Styling with Code: Fully Immers... > Creating External Style Sheets

Creating External Style Sheets

By far the most powerful feature of CSS is that it gives you the ability to create styles, classes, and IDs stored in one central location and applied to many different pages or entire sites. This is where the Sheets part of the name Cascading Style Sheets (CSS) comes from.

An external style sheet is a dedicated file with the extension .css that contains only style code. Until now, Expression Web 4 has inserted all the style code you created into the head of your HTML pages, but doing so limits their application to that particular page. Now you need to move the styles from the HTML page to a new style sheet so that you can apply the same styles to multiple pages.

To create an external style sheet, you first have to create a .css file. The easiest way to create a .css file is to click the down arrow next to the New icon on the Common Toolbar and select CSS in the context menu. This creates a new file named Untitled_1.css. In most cases, the style sheet name is simply styles.css, but it is often a good idea to be more specific in naming to ensure that you know which site each sheet belongs to. After creating the new file, go to File, select Save As, and give it the name kippleStyles.css. When saved, it appears in the Folder panel, as shown in Figure 12.8.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint