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

Chapter 2. Mastering CSS > Building a Master Style Sheet

Building a Master Style Sheet

CSS allows you to place styles into an external style sheet (really just a text file holding all of the CSS rules) and then link or import that file into your HTML. This allows you not only to separate the styles from the code used to actually structure the page, but also to place multiple style sheets in a single Web page. Many Web designers do this—they link to various style sheets for various tasks by placing a <link> tag in the head of each document.

However, there is a disadvantage to using the <include> tag in the head of your document: What if you need to add or delete a linked style sheet from your pages globally? The solution is to link to a single style sheet and then use @import to aggregate the various style sheets (Figure 2.7). Then, to add or remove one, you can simply edit this single file.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint