Creative Commons License

The following style guide was developed by silverorange for a client of silverorange. With their permission, we have released this style guide under the Attribution-ShareAlike License from the Creative Commons. For more information on this document, see the silverorange labs post on the subject.

Example Style Guide

The following document is a style guide for producing content for the [client] Web site. This document outlines basic principles for adding content to the site, defines the basic style sheet classes available to content managers and how they should be used, and defines principles, guidelines, and best practices for content.

1.0 Coding Standards

The [client] site is designed to the XHTML 1.0 Transitional and CSS specification as designed by the W3C (World Wide Web Consortium). The most important standard for content managers is the XHTML 1.0 specification. All code added to the site must validate as XHTML 1.0. The following sections will explain how to make your code validate and how to check your validation.

1.1 Why are Standards Important?

Much non-standard HTML looks just fine in your browser, so why is maintaining standards so important? There are actually several compelling reasons.

  1. Standards mean that the site will be up-to-date now and will be easier to keep up-to-date in the future. Writing code with standards means all of the code on the entire site matches a single specification that will be supported by future browsers. Just because your pages look good now on your browser does not mean they’ll look good in future browsers unless they’re compliant with modern standards.

  2. Standards make the site faster. Particularly using CSS, the amount of actual code being sent to the visitor is significantly reduced, making visitors happier with load time and system administrators happier with server load.

  3. Standards make the site more accessible for users with disabilities. Simpler, cleaner code is easier for screen readers to interpret. Scalable font sizes make text easier to read for people with reduced sight. Descriptive ALT text helps people who are unable to see photos or read graphical text.

  4. Standards make the site more versatile to work on non-traditional browsers. More people are using handheld devices, cell phones, and other technologies to browse the web. These devices have different requirements and standards code is much more scalable for such applications.

1.2 Writing XHTML Valid Code

There are a number of key rules to keep in mind when coding to be XHTML compliant. Remember these and you’ll have no problem making your code work.

1.3 Validating Your Code

The easiest way to ensure you’re writing XHTML 1.0 valid code, you can use the W3C tools to validate your code. Every page should be checked before it is put on the live site.

To validate your code, use the Favelet for “Validate This Page” available at http://validator.w3.org/favelets.html. When you add this as a bookmark or link in your browser you can quickly validate the page as you work on it.

2.0 Using Style Sheets

The [client] site has a well-defined style sheet that can be used in all new content being added. As much as possible, content managers should try to keep to the standards set out in this style sheet to maintain conformity throughout the site. Also, as much as possible, basic tags should be employed where complex formatting can be avoided. For instance, definition lists and unordered lists should be used wherever appropriate and table formatting of content should be avoided wherever possible.

2.1 Header Tags

As much as possible, titles on the site should be defined with the appropriate header tag. Graphical titles should be avoided wherever possible. All six header tags are defined in the style sheet and should be used appropriately. The <h1> tag should most often be used as the page title at the top of the page.

2.2 Special Text-Formatting Classes

As much as possible, normal text should be used throughout the site. However, in certain instances text formatting is required. The following are some simple ways to format text.

<div class="subtext"> Text inside an element with a class of subtext will appear smaller.
<ul class="spaced"> All list items (bullet points) within the list will have a line space between them. This works for <ol> and <ul> lists.
<p class="first"> Removes the automatic margin on the top of a paragraph. Usually used for the first paragraph following a header.

3.0 Content Guidelines

Aside from the strict rules governing compliance with standards, there are a number of best practices which should be followed for all content added to the site. Some of the following guidelines are basic principles to work by and some are specific guidelines that give specific directions for content management.

3.1 General Principles to Follow

3.2 Required Content Guidelines

3.3 Best Practices for Content

Creative Commons License

This document is covered by the Attribution-ShareAlike License from the Creative Commons. For more information on this document, see the silverorange labs post on the subject.