Book HomeCascading Style Sheets: The Definitive GuideSearch this book Friday 20th of April 2018 04:39:20 PM

0.2. Property Conventions

Throughout this book, there are boxes that break down a given CSS property. These have been reproduced practically verbatim from the CSS specifications, but some explanation of the syntax is in order.

Throughout, the allowed values for each property are listed with a syntax like the following:

Value: [ <length> | thick | thin ]{1,4}

Value: [<family-name> , ]* <family-name>

Value: <url>? <color> [ / <color> ]?

Value: <url> || <color>

Any words between < and > give a type of value, or a reference to another property. For example, the property font will accept values which actually belong to the property font-family. This is denoted by using the text "<font-family>." Any words presented in constant width text are keywords that must appear literally, without quotes. The forward slash ( / ) and the comma ( , ) must also be used literally.

Several keywords strung together means that all of them must occur -- in the given order. For example, help me would mean that the property must use those keywords in that exact order.

If a vertical bar ( X | Y ) separates alternatives, then any one of them must occur. A vertical double bar ( X || Y ) means that either X or Y, or both, must occur, but they may appear in any order. Brackets ( [...] ) are for grouping things together. Juxtaposition is stronger than the double bar, and the double bar is stronger than the bar. Thus "V W | X || Y Z" is equivalent to " [ V W ] | [ X || [ Y Z ]] ."

Every word or bracketed group may be followed by one of the following modifiers:

Following are some examples:

give|| me|| liberty

At least one of the three words must be used, and all of them can be used in any order. For example, give liberty, give me, liberty me give, and give me liberty are all valid interpretations of this example.

[ I| am] ? the|| walrus

Either, but not both, of the words I or am may be used, but use of either is optional. In addition, either the or walrus, or both, must follow. Thus, you could construct I the walrus, am walrus the, am the, I walrus, walrus the, and so forth.

koo+ ka-choo

One or more instances of koo must be followed by ka-choo. Therefore, koo koo ka-choo, koo koo koo ka-choo, and koo ka-choo are all legal. The number of koos is potentially infinite, although there are bound to be implementation-specific limits.

I really {1,4}* [ love| hate] [ Microsoft| Netscape ]

The all-purpose web designer's opinion-expresser. This can be interpreted as I love Netscape, I really love Microsoft, and similar expressions. Anywhere from zero to four really s may be used. You also get to pick between love and hate, even though only love was shown in this example.

[[[ Alpha|| Baker|| Cray ] ,]{2,3} and ] Delphi

This is a potentially long and complicated expression. One possible result would be Alpha, Cray, and Delphi. Another is Alpha Baker, Cray Alpha, 12pt and a line-height of 36pt, its content area is 12pt high, and the content area is what will be surrounded with the border.

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

SPAN {border: 1px dashed black; padding: 4pt;}
Baker Cray Alpha, and Delphi. The comma is placed due to its position within the nested bracket groups.

Library Navigation Links

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

know is, "How do I set colors on my web page?" UnderHTML, there were two choices: use one of a small number of colorswith names, like red or purple,or employ a vaguely cryptic method using hexadecimal codes. Well,both of those methods for describing colors can be found in CSS, aswell as some other methods that are only moderately complex.

3.1.1. Named Colors

Assuming that you're happy with picking from a small, basic setand <SPAN STYLE="vertical-align: top;">tall</SPAN> and which is<BR>larger than the surrounding text.</P>

Now we're back to our earlier example, where the middle linebox is taller than the other line boxes. However, notice how the"tall" text is aligned in Figure 8-54.

Figure 8-54

Figure 8-54. Top-aligning text

What's happened here is that the top of the "tall"text's inline box is aligned with the top of the line box. setting the margins and not declaring anything for thewidth. The result of this markup is exactly thesame as that shown in Figure 8-13:

P {margin-left: 100px; margin-right: 100px;} /* same as before */


In practice, only browsers released in early 1999 or later correctlyhandle auto, and not even all of them get itright. Those that do not handle auto marginscorrectly will behave in inconsistent ways, but the safest bet is to

The 2nd category of Java applications called Java Application Servers (or app servers) and they make good use of XML. Unlike client side graphical Java apps (from the previous section) which are very standalone in their operations, app servers tie many different networked software components together in order to provide information from multiple sources to a set of client side Java apps or web browsers (maybe even running on different devices). This is shown in Figure 2. An app server is actually a conglomeration of several distributed and client/server software systems. So when you write an app server, you are actually writing many different software systems which are all networked to work together, to process information that comes from various sources, and distribute this information to a set of client apps (that you also have to write) running on different devices and platforms.

How can XML help app servers do their work? As you can see in Figure 2, in order for the app server to harvest information from such a rich variety of sources, there must be some common ground between all of these sources (each of which might be running on a different hardware and software system). This common ground is the information which flows throughout the entire system, regardless of what source the information comes from. CORBA is an example of tying disparate systems together based on the interfaces that certain remote objects implement. XML does the same thing for data. It allows these disparate systems to share information in a medium that consists only of pure information (and the structural relationships that exist inside of that information). By taking the lowest common denominator approach by using plain text to encode data, XML allows these systems to talk with each other without requiring any special binary information format converters or other service layers to translate between binary formats (for encoding data). Also, since HTTP already supports transmission of plain text, it is completely natural to move XML around using the Hyper Text Transfer Protocol through firewalls and disparate networks. This is shown in Figure 3. XML can be transmitted between systems using one of the most prevalent protocols in use today, Hypertext Transfer Protocol or HTTP 1.1 (which is the protocol of the web).