Book HomeCascading Style Sheets: The Definitive GuideSearch this book Friday 20th of April 2018 04:37:22 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.

known as a pixel, which is a term to which we'llreturn later in the chapter.

Given the way colors are created on a monitor, it makes sense that agood way to let you set colors is to give you direct access to thosecolor levels, thereby determining your own mixture of the beams. Thismethod is a bit more complex, obviously, but the payoffs are worth itbecause you aren't limited to whichever colors have been named.

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.

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.

inline box which is 18 points tall. This sounds like a roundabout way to describe how line height works, but rest assured that there are excellent reasons for the description. See Chapter 8, "Visual Formatting", for a detailed explanation of the inline formatting model.

If you use the default value of normal, the amount of vertical space between lines will be the user agent's default. This is generally somewhere between 1.0 and 1.2 times the size of the font, but this can vary by user agent.

XML documents are easily committed to a persistence layer

XML documents may be stored in files or databases. When stored in files, XML documents are simply plain text files with tags (and possibly DTDs). It is very easy to save your XML documents to a text file and pass the text file around to other machines, platforms and programs (as long as they can understand the data). In the worst case scenario, XML documents (files) can be viewed in a text editor on just about any platform.

XML documents are also naturally committed to a database (relational or object) or any other kind of XML document store. There are commercial products available which allow you to save XML documents to an XML storage layer (which is not a database per se), like Datachannel's XStore and ODI's eXcelon. These XML store solutions are quite expensive ($10,000 to $20,000 range).

XML documents are also quite naturally retrieved from a persistence layer (databases, file systems, XML stores). This lends XML to be used in real world applications where the information being used by different parts of a system is the most important thing.

width. Thus, if the sum of the seven propertiesmust equal 400 pixels, and no padding or borders are set, and theright margin and width are set to 100px while theleft margin is set to auto, then the left marginwill be 200 pixels wide:

P {margin-left: auto; margin-right: 100px; width: 100px;} 

The results are shown in Figure 8-11.

Figure 8-11

Figure 8-11. Automatic left margin

In a sense, auto can be used to say, "make

Figure 8-52

Figure 8-52. The final paragraph of stacked line boxes

As we can see, the middle line is taller than the other two, but itstill isn't big enough to contain the text within it.That's because the position of the inline boxes in the lineforces it to be taller than 12 pixels, but the line-box stillisn't tall enough for the text to avoid overlapping otherlines.

The situation can become markedly different if we change the verticalalignment of the inline boxes. Suppose that we change the boldfacebe placed inside any other element, rather likeTITLE or STYLE. This will causethe web browser to locate and load the style sheet and use whateverstyles it contains to render the HTML document, in the manner shownin Figure 1-2.

And what is the format of an external style sheet? It's simplya list of rules, just like those we saw in the previous section andin the example above, but in this case, the rules are saved intotheir own file. Just remember that no HTML or any other markup