Using External Style Sheets I hope you and CSS have been getting along and having fun together. But up until this point, all the CSS work you've been doing has been within an embedded style sheetthat is, all your styles are being stored in a style sheet that resides within your current page.Chapter 4 we talked about uploading your site, along with any other files that are needed, to your remote site folder). To have the style sheet control multiple pages, you'll have to connect your pages to it, a process that you'll learn about shortly. Because your pages will be linked to the style sheet file, you'll need to make any formatting changes there, not in your web pages. Then, like magic, you'll be able to update the formatting right across your site in seconds! External style sheets are by far the most powerful tools for harnessing the capabilities of CSS.
Giv89 the Heave-HoUse CSS to Control Lists! Just like the formatting of tables, headings, and other page elements, the formatting of lists is determined by HTML tags. But rather than being content with this vanilla formatting, consider using CSS to give your lists a makeover. Try dressing up your lists with custom bullets, using tiny graphics or symbols saved as JPG, GIF, or PNG files in your local root folder.In this example, you'll set up an unordered list as you normally would, but then you'll use CSS to change the rules of the unordered list formatting. The process works the same for ordered lists as well.Here's how to use CSS to control your lists:
1. | Select the text on your page that you want to convert to a list. | 2. | In the Property Inspector, click the ordered or unordered list button. We're working with a bulleted list in this example, so click the Unordered List button. | 3. | At the bottom of the CSS Styles panel (Window > CSS Styles), click the New CSS Rule button. | 4. | In the New CSS Rule dialog box, set the Selector Type to Tag, and from the Tag pull-down menu, choose ul.I98, ul is the code that controls an unordered list. | 5. | Set Define In to This Document Only; then click OK. | 6. | In the CSS Rule Definition dialog box, select the List category. | 7. | Choose your bullet style either through the Type menu (for a predefined bullet character) or the Bullet image field, where you can browse to a custom graphic image.I recommend that you choose one of the first three bullet choices if you use the Type menu. Although you could choose a numeric (decimal), roman, or alphabetic value as your bullet character, this might cause confusion. If you're making ordered lists, it would make more sense to redefine the ordered list (ol) tag instead. | 8. | If your bulleted text is long enough to break onto another line, use the Position menu to specify whether the wrapped text aligns with the bullet's indent or with the page margin.Inside aligns the wrapped text to the page margin, and Outside aligns the text to the bullet's indent. | 9. | Before finishing, you can use any other category in the CSS Rule Definition dialog box to further control the look of your text. For example, to adjust the amount of space your bullets indent, select the Block category and enter a value in the Text Indent field. You can also set other formatting, such as font, color, and so on, at this point. | 10. | When you're done, click OK.The bulleted items on your page reformat to reflect your new formatting, and ul appears in the CSS Styles panel.[View full size image] If you want to make changes to your formatting, use the Properties pane in the lower half of the CSS Styles panel, or double-click ul in the rules list to return to the CSS Rule Definition dialog box. |
| Geek's Delight | Web browsers store external style sheets in their browser cache, meaning that your site will load faster where bandwidth is a concern. Usually, a CSS file's size is next to nothing, but sometimes those folks with antique browsers also have antique computers with matching antique Internet access. Caching your external style sheet will help speed up load time for those old-timers. | If you use an external style sheet for your site, you can connect an unlimited number of web pages to it. This means that you can control your entire site from a single file. Killer!

Exporting Embedded Sheets You've seen how to create custom class styles, and you redefined som89 tags. Only problem is that all your lovely styles have been created in an embedded style sheetthey're all trapped in your page and can be used only there. That's no good. As they say, if you truly love something, set it free.Unfortunately, the CSS styles applied here are available only to this page, because they're being stored in an embedded style sheet. They need to be exported to an external style sheet so they can be used throughout the site.Chapter 13. |