Book HomeCascading Style Sheets: The Definitive GuideSearch this book Sunday 25th of February 2018 10:31:31 PM


Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects.

The animals on the cover of Cascading Style Sheets: The Definitive Guide are salmon (salmonidae), which is a family of fish consisting of many different species. Two of the most common salmon are the Pacific salmon and the Atlantic salmon.

Pacific salmon live in the northern Pacific Ocean off the coasts of North America and Asia. There are five subspecies of Pacific salmon, with an average weight of ten to thirty pounds and an average age of five years. Pacific salmon are born in the fall in freshwater stream gravel beds, where they incubate through the winter and emerge as inch-long fish. They live for a year or two in the stream or lake, and then head downstream to the ocean. There they live for a few years, before heading back upstream to their exact place of birth to spawn and then die.

Atlantic salmon live in the northern Atlantic Ocean off the coasts of North America and Europe. There are many subspecies of Atlantic salmon, including the trout and the char. Their typical size is ten to twenty pounds, with an average age of seven to ten years. The Atlantic salmon family has a similar life cycle to its Pacific cousins, from freshwater gravel beds to the sea. A major difference between the two, however, is that the Atlantic salmon does not die after spawning; it can return to the ocean and then return to the stream to spawn again, usually two or three times.

Salmon, in general, are graceful, silver-colored fish with spots on their backs and fins. Their diet consists of plankton, insect larvae, shrimp, and smaller fish. Their unusually keen sense of smell is thought to be what helps them navigate from the ocean back to the exact spot of their birth, upstream past many obstacles. Some species of salmon remain landlocked, living their entire lives in freshwater.

P.wide {margin-left: -50px; width: auto; margin-right: 10px; border: 3px solid gray;}
Figure 8-20

Figure 8-20. Setting a negative left margin

In this case, not only does the paragraph spill beyond the borders of the DIV, but also beyond the edge of the browser window itself!


Remember that padding, borders, and content widths can never be negative. Only margins can be less than zero.

Salmon are an important part of the ecosystem, as their decaying bodies provide fertilizer for streambeds. Their numbers have been dwindling over the years, however. Factors in the declining salmon population include habitat destruction, fishing, dams that block spawning paths, acid rain, droughts, floods, and pollution.

Melanie Wang was the production editor and copyeditor for Cascading Style Sheets: The Definitive Guide. Madeleine Newell was the proofreader, and Jeff Holcomb and Colleen Gorman provided quality control. Maeve O'Meara, Mary Sheehan, Emily Quill, Ann Schirmer, Jeff Holcomb, and Colleen Gorman provided production support. Brenda Miller wrote the index.

Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 3.32 using Adobe's ITC Garamond font.

Alicia Cech designed the interior layout based on a series design by Nancy Priest. Mike Sierra implemented the design in FrameMaker 5.5.6. The text and heading fonts are ITC Garamond Light and Garamond Book. The illustrations that appear in the book were produced by Robert Romano and Rhon Porter using Macromedia FreeHand 8 and Adobe Photoshop 5. This colophon was written by Nicole Arigo.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

vertically aligned to 50%, and within that same line, there is an image 50 pixels tall, you get the result shown in Figure 4-42:

SUP {vertical-align: 50%;}
Figure 4-42

Figure 4-42. Vertical alignment with a percentage and a tall image

The 50%-aligned element has its baseline raised 7 pixels (which is half of 14px), not 25 pixels. Also note that the line-box has been made tall enough to accommodate the image. This is actually consistent with the

Second, all of the inline elements in a given line are aligned according to their values for vertical-align. By default, this will cause all text in the line to be aligned along their baselines, but of course different vertical-align values will have different effects. All of the elements could be top-aligned, for example. We'll return to vertical alignment later in the chapter, but for now will assume that everything is baseline-aligned.

high, and the content area is what will be surrounded with theborder.

This behavior can be altered by assigning padding to the inlineelement, which will push the borders away from the text itself (shownin Figure 8-58):

SPAN {border: 1px dashed black; padding: 4pt;}
Figure 8-58

Figure 8-58. Inline padding and line-box layout

Note that this padding does not alter the actual shape of the