The careful analysis of more than 35,000 pages of self-improvement materials published in the past 100 years leads us to the conclusion that there are really only 10 basic keys to optimum performance and success.
Energy - Committing to Peak Power 115 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the CascadeThere are no dead optimum performers, are there? To achieve even minimal performance, you have to be, act, and feel alive If you don't have the energy to whatever it takes, you'll never perform up to your true potential.
Mission - Living What's Most ImportantUntil you know what's important, you're spending the only life you have on things that simply don't matter Lacking direction and purpose, you're powerless to make a real difference in your life However, all self-imposed limitations are removed when you tap into the infinite power generated by 'working from your heart,' fulfilling a clearly defined mission.
Attitude - Transform Passion into ActionEven though you may have a passion for what's most important, until you also believe that you can make a real difference in your life and the lives of those around you, nothing's going to happen Nothing is produced, nor even attempted, until you believe in yourself enough to transform your passion into action.
From "The Power of TQ" by Nine to Five Screen Gems Software, Inc Reprinted by permission. There’s nothing too complicated here Nor is there anything very interesting to look at, even though the content itself might interest someone Now, let’s see what happens when we center the top headline, and move the subheadings so they’re aligned to the right side of the page rather than the left The result is shown in Figure 7.3 The style sheet rules that produce the effect in Figure 7.3 are pretty simple: File: tenkeys.css h1 { text-align: center; } h2 { text-align: right; } 116 Licensed to siowchen@darke.biz Moving from Crowded to Airy Design Using Alignment Figure 7.3 Applying headline alignment to basic text layout While the layout of the page is admittedly unorthodox, you have to admit that it’s more interesting than what we started with The “air,” or negative space, created to the left of the subheadings is attention-getting 117 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the Cascade Figure 7.4 Centering text in paragraphs for a different effect This page consists of headlines that are followed by associated paragraphs of pithy advice The whole scheme seems to lend itself to something more closely resembling a promotional design Let’s try centering the paragraph text Now the page looks like Figure 7.4 The style sheet that generates Figure 7.4 is shown here: File: tenkeys.css h1 { text-align: center; } h2 { text-align: right; } p { text-align: center; } 118 Licensed to siowchen@darke.biz Moving from Crowded to Airy Design Using Alignment Whether or not you like your paragraphs centered, you can probably see where I’m heading with this concept By altering the text-align property of text ele ments on the page, we can create more negative space and more pleasing page layouts—even if we don’t anything else That said, I couldn’t resist making one last change that involves color, not alignment Figure 7.5 shows you what putting a background color behind the heading text does for the additional negative space I’ve used a yellow back ground—though you can’t tell—but the fact that it’s a solid color produces the same effect as negative space, while providing yet another way for us to guide readers’ eyes to the content we want them to see: the main subheadings Figure 7.5 Adding a color background to subheadings to emphasize negative space Here’s the style sheet that creates the effect in Figure 7.5: 119 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the Cascade File: tenkeys.css h1 { text-align: center; } h2 { text-align: right; background-color: yellow; } p { text-align: center; } First-line Indentation In the example in the previous section, I centered the text in the explanatory paragraphs under each subheading As I said at the time, that wasn’t necessarily a great design, but it did demonstrate how alignment can produce “air” or negative space Another, perhaps more conventional, way to accomplish this objective with blocks of text is to indent the first line of each paragraph The text-indent property controls the amount of extra left padding that’s applied to the first line of a block of text The property requires as its value a measurement or percentage of the element width Let’s put text-indent to work Replace the style rule for paragraphs in the above CSS with a new one, like this: File: tenkeys.css (excerpt) p { text-indent: 2em; } The result will look like Figure 7.6 120 Licensed to siowchen@darke.biz First-line Indentation Figure 7.6 Indenting the first line of text in each paragraph Figure 7.7 Outdenting the first line of text in a paragraph A variation on first-line indent is first-line outdent, also called a hanging indent, where the first line is closer to the left margin than the rest of the paragraph You can see this effect in the first paragraph of Figure 7.7 Here are the CSS rules that we add to the style sheet to accomplish the styling shown in Figure 7.7: File: tenkeys.css (excerpt) p.outdent { padding-left: 2em; text-indent: -2em; } Here, I’ve assigned a left padding value of two ems to the entire paragraph, then removed that padding from the first line by setting a negative text-indent of the same amount 121 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the Cascade In the HTML, I’ve simply assigned the outdent class to the first paragraph of the document: File: tenkeys.html (excerpt) Ten Keys to Optimum PerformanceThe careful analysis of more than 35,000 pages of self-improvement materials published in the past 100 years leads us to the conclusion that there are really only 10 basic keys to optimum performance and success.
When you use a negative value for the text-indent property, you have to be careful that the first line of text doesn’t end up falling outside the boundaries of the browser window In general, this means you need to assign a padding-left of at least the same size as the negative indent you choose Horizontal and Vertical Spacing CSS rules allow you to control spacing between lines, letters, and words You can use these properties to create interesting visual effects, to improve the readability of text, or sometimes, to fit text into a tight spot The line-height Property All elements in a web page are affected by a line-height property This property refers to the total distance between the baselines of two adjacent lines of text The baseline of a line of text is the imaginary horizontal line most letters sit on—you can see this line clearly in the word “baseline” itself By default, browsers create a line-height that ensures the readability of vertically adjacent lines or elements For example, if the text in a paragraph is set in a 12 point font, the browser will usually provide one point of spacing above and an other point of spacing below the line, creating a total line-height of 14 points When you explicitly set the line-height for an element such as a heading or paragraph, you effectively tell the browser to increase or decrease the amount of space between that line and those that are vertically adjacent to it This space is called leading (pronounced like “heading,” not like “reading”), a term that’s left over from the days when type was set using molten lead formed into bars of type, one for each line Spacing was created by placing thin, blank slugs between the lines 122 Licensed to siowchen@darke.biz The line-height Property Leading can create additional negative space in a web page layout Figure 7.8 shows how the page we’ve been working with looks if the following style rule is applied: File: tenkeys.css (excerpt) p { text-indent: 2em; line-height: 1.5em; } This effectively creates text that is one and one-half line spaced Figure 7.8 Using the line-height property to create 1.5-line spaced text It’s important to realize that when you set the line-height property using a relative measurement (such as an em value or percentage), that value is applied on the basis of the current element’s font settings, not on those of the parent, as 123 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the Cascade is the case with most other font control properties Thus, if you have a paragraph with a 12-pixel font that’s contained in a div with an 18-pixel font, for example, a line-height value of two ems for the paragraph would produce an actual line height of 24 pixels, not 36 The line-height property is the first CSS property we’ve encountered that can take a pure numerical argument, as in this example: p { line-height: 1.5; } This has the same visual effect as would supplying a value of 1.5em, or a value of 150% The difference between a numeric value and a CSS measurement is that a numeric value is inherited directly by child elements, which will apply it to their own font sizes, while relative values cause the actual line height to be inherited by children This is easier to demonstrate than to explain Figure 7.9 shows two different paragraphs, set in large type, to dramatize the different effects of numeric and relative line-height properties The text in the figure explains how each paragraph was formatted relative to the div container of which it is part Figure 7.9 Relative versus numeric line-height property values The first paragraph is contained in a div with a line-height of 2em The para graph therefore inherits the line height that results when you double the default 124 Licensed to siowchen@darke.biz The letter-spacing and word-spacing Properties line height produced by the div element’s font (in this case, the browser’s default font size, which is usually 12 points) As the paragraph uses a larger font than the div, the line spacing looks very crowded The second paragraph is contained in a div with a line-height of Instead of passing on the exact line height, the inherited value of is used by the paragraph to determine a line-height based on its own, larger font This produces the double-spaced effect we probably intended For this reason, it is generally best to stick to numeric values for the line-height property, unless you know you’re striving for a really different vertical spacing effect, and understand the consequences of using CSS measurement values The letter-spacing and word-spacing Properties The letter-spacing property defines the amount of space between the letters in the text element to which it is applied It can take an absolute or relative value, and its default setting is normal Figure 7.10 shows an extreme example of letter-spacing created so you can see the effect Figure 7.10 Using letter-spacing to define distance between letters Here’s the HTML page that generates Figure 7.10: File: spacy.html Letter and Word Spacing spacy { letter-spacing: 0.5em; }All paragraphs identified with the class 'spacy' on this page are set to 0.5 ems of letter spacing You can see here the effect of that setting.
This paragraph is not an instance of the class 'spacy' so it has default letter spacing.
Notice that the spacing between words is elongated as well, so the words continue to appear as a grouping of letters that are closer together than the words are to one another You can also apply negative values to the letter-spacing property to cause letters to appear closer to one another One situation in which letter-spacing comes in particularly handy occurs where a headline appears to have a bit too much inter-letter spacing This often happens with monospaced fonts, but it can be annoying or distracting with sans-serif fonts as well In Figure 7.11, this effect is put to good use The top headline on the page does not use any letter-spacing Notice how the words containing the letters “i” and “l” and “t,” in particular, look a little too “airy.” This is a characteristic of monospaced fonts, but with the CSS letter-spacing property, you can overcome this problem and continue to use this type of font where it’s most ap propriate Figure 7.11 Using negative letter-spacing to tighten up monospace fonts 126 Licensed to siowchen@darke.biz The letter-spacing and word-spacing Properties Here’s the HTML that produces the page in Figure 7.11 Notice that I defined a class called “compress,” then applied it to one of the h1 heading elements: File: compress.html Letter Spacing in Headlines h1 { font-family: "Courier New", Courier, monospace; } compress { letter-spacing: -0.05em; } This Is a Little Too Spread Out This Is a Little Bit Better As you can see, I decreased letter spacing only by a small amount (5% of the width of a character) to achieve the desired result You’ll need to experiment with the effects of the letter-spacing property with various fonts and type sizes to know what will work best in a given situation Another case in which letter-spacing is particularly effective is in creating a different visual effect for a page heading Figure 7.12 shows a heading that makes effective use of letter spacing to create a graphically interesting effect without the use of graphic tools Figure 7.12 Using letter-spacing to create an interesting visual effect 127 Licensed to siowchen@darke.biz Chapter 7: Text Effects and the Cascade The HTML that creates the effect shown in Figure 7.12 is simplicity itself: File: joecool.html Cool Headline With Letter Spacing h1.pageheading { font-family: 'Courier New', Courier, monospace; font-size: 18pt; letter-spacing: 0.7em; text-transform: lowercase; } Joe Cool's Web HangoutThe stretched-out headline above almost acts like a logo for Joe Cool's web site, but it is created without a graphics tool
The word-spacing property determines the spacing between words However, versions of Internet Explorer earlier than don’t support this property.2 Figure 7.13 depicts the effect a word-spacing setting of 1em has on an oversized sentence Figure 7.13 The word-spacing property at work Internet Explorer version for the Macintosh does support this property, but its implementation is buggy and results in word overlap in some circumstances 128 Licensed to siowchen@darke.biz ... Here’s the HTML that produced Figure 7.2: File: tenkeys .html (excerpt) ... elements: File: compress .html Letter... itself: File: joecool .html Cool