27.02.2013 Views

Suitcase Fusion 3 User Guide for Mac OS - Extensis

Suitcase Fusion 3 User Guide for Mac OS - Extensis

Suitcase Fusion 3 User Guide for Mac OS - Extensis

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tips & Techniques<br />

There are many websites, book chapters, and blogs devoted to identifying “best practices” <strong>for</strong> using CSS. These<br />

are somewhat subjective and of course can change over time as browsers evolve and new technologies like<br />

WebINK become available.<br />

Instead of best practices here are some ideas, tips, and techniques that you can investigate <strong>for</strong> using in your<br />

own websites. Some will be fairly obvious and long-lasting, while others may only be valid <strong>for</strong> certain people or<br />

situations. We suggest that you review them, investigate those that sound promising, modify as necessary, and<br />

implement them as your own best practices. But don’t <strong>for</strong>get to try new techniques and revise your strategies.<br />

Tried and True<br />

These tips won’t steer you wrong.<br />

• Use external style sheets.<br />

External style sheets give you the most flexibility in applying <strong>for</strong>matting across your website. Internal and<br />

inline style sheets can quickly become unmanageable when you go to make changes.<br />

• Use classes and IDs.<br />

You get greater flexibility in structuring your pages and styling your text when you implement these.<br />

• Learn about media types.<br />

CSS lets you define selectors differently depending on the device that the HTML content is output to.<br />

Using the @media rule, you can change the way your content is <strong>for</strong>matted <strong>for</strong> the printed page, and can<br />

also make it easier <strong>for</strong> a screen reader (a program that reads screen content aloud) to describe your page<br />

accurately.<br />

CSS Formatting<br />

You might think that, once you’ve got your CSS typed into a text file and deployed, you are done with it. But<br />

when you want to (or need to!) go back and modify it, you will want it to be well-organized, easy to navigate, and<br />

self-descriptive.<br />

• Use comments.<br />

A CSS comment is any text that starts with the two characters /* and ends with the two characters */.<br />

You can use these to describe what your CSS is doing, set off sections of your CSS, or to temporarily<br />

“disable” some definitions.<br />

• Organize your style sheets in a consistent manner.<br />

Break your stylesheet into sections, such as General, Special Formatting, and Layout. Identify each<br />

section with a comment line.<br />

• Use CSS shorthand.<br />

Many properties can be grouped together. For example, instead of the rule p {font-size: 12px;<br />

font-style: italic; font-family: Arial, sans-serif} you can use p {font: italic<br />

12px Arial, sans-serif;}. While this can keep your definition compact, you do need to be aware of<br />

the order that you place the properties.<br />

• Combine rules.<br />

When rules share identical properties, you can combine those properties into one definition, then include<br />

other definitions to include the unique properties <strong>for</strong> each selector. You combine definitions by separating<br />

selectors with a comma: h1, h2, h3 {font-family: Arial Black, sans-serif; color:<br />

darkgray; }.<br />

• Use multi-line definitions as needed.<br />

Some designers like to put their definitions all on one line, and others like to spread them out with one<br />

property per line <strong>for</strong> readability. However you choose to write your rules, be consistent. Always define<br />

properties in the same order so you can find them at a glance.<br />

- 81 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!