12.1. The Purpose of Styles

Styles are an electronic publishing invention for dynamically coding text and other document elements with formatting. For example, a style called "Heading" would be attached to every heading in the document. The style definition would contain information on how headings should be formatted. In this book, for example, headings (such as "The Purpose of Styles," above) use a larger, bold font.

The advantage of styles is that you can change the definition once and the change affects every element using that style. Coding each element individually, by contrast, would require that each element be recoded when you wanted them all to change. Thus, styles provide an easy means to update document formatting and maintain consistency across a site.

Also, coding individual elements is best done while the document is being created. This means that the document must be formatted by the author—not always the best choice. Instead, the elements can be tagged with appropriate styles (such as heading) while the document is created, and the final formatting can be left up to another individual who defines the styles.

Styles can be grouped into purpose-driven style sheets. Style sheets are just that, groups of styles relating to a common purpose. Style sheets allow for multiple styles to be attached to a document all at once. It also allows for all the style formatting in a document to be changed at once. This allows documents to be quickly formatted for different purposes—one style sheet can be used for online documents, another for brochures, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.91.44