Errata

CSS: The Definitive Guide

Errata for CSS: The Definitive Guide

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page xiii
1st to 4th line

"[I | am]? the || walrus"

According to the precedence rules from page xv (and the CSS 2.1 specification) this
is equivalent to [[I | am]? the] || walrus

"Either the word 'I' or 'am' may be used, but not both, but use of either is
optional. In addition, either 'the' or 'walrus', or both, must follow in any order."

This does not fit the expression. One must use either 'the' or 'walrus', or both in
any order. In addition, if 'the' is used, it may optionally be preceded with either
'I' or 'am' (but not both).

"Thus, you could construct I the walrus, am walrus the, am the, I walrus, walrus the,
and so forth"

The following constructs must be removed or replaced:
* am walrus the

Anonymous   
PDF Page xiii
7th paragraph

Given this:
"I really{1,4}? [love | hate] [Microsoft | Netscape | Opera | Safari]"
The sentence below it should be:
"Anywhere from one to four reallys may be used."

Or change the initial sentence to:
"I really{0,4}? [love | hate] [Microsoft | Netscape | Opera | Safari]"

Chris Simmons  Feb 26, 2011 
Printed Page 14
last paragraph

Current text:
"CSS2 defines a number of allowed values for this attribute"

Should be:
"HTML 4.0 defines a number of allowed values for this attribute"

Per Sundin  Sep 25, 2010 
Printed Page 17
2nd paragraph from bottom

Current text:
"in the case of a CSS document"
Suggested text:
"in the case of a CSS style sheet"

Per Sundin  Sep 26, 2010 
Printed Page 20
Last paragraph

Current text:
"If you wish to place comments on the same line as markup, ..."
Suggestion:
"If you wish to place comments on the same line as rules, ..."

Per Sundin  Sep 26, 2010 
Printed Page 27
3rd paragraph from bottom

This makes no sense to me:
"But what if you want the same style to apply to multiple elements? If that's the case, you'll want to ... apply more than one style to an element or group of elements."

Per Sundin  Sep 26, 2010 
Printed Page 32
2nd paragraph from bottom

Current text:
"In HTML documents, you can use a very compact notation ..."
Should be:
"In CSS style sheets, you can use a very compact notation ..."

Per Sundin  Sep 26, 2010 
Printed Page 110
Figure 5-12 and code example above it

In the code before Figure 5-12:
small, .fnote {font-size: 70%;}
...
<p class="fnote"> 10.5px </p>

Should be:
small, .fnote {font-size: 75%;}
...
<p class="fnote"> 11.25px </p>

In figure 5-12, replace "10.5px" with "11.25px".

All the above should be done in order to match the text "...smaller by a quarter", found in the example, and also to match the text on page 111: "Multiplying that value by 75% yields 11.25."

Per Sundin  Oct 07, 2010 
Printed Page 171
Last line

My copy has 1/08 in the lower right corner. On page 171, last line, I think the word "height" should be capitalized. I was looking for the beginning of the sentence but then figured maybe it was a typo. Same type of error on page 163, second from the last line. I believe "width" should be capitalized. It's a little confusing is all. Great book!

David Spitzer  Jan 27, 2009 
Printed Page 171
1st paragraph

If the containing clock contains two block-level elements, doesn't this paragraph imply that the height of each is the same as the height of the containing block? That doesn't make sense.

Tim Boemker  Oct 31, 2011 
Printed Page 172
1st paragraph

"Since setting the top and bottom margins to auto will give them zero height, the only way to vertically center the element is to set them both to 25%."

This won't work since the 25% will be relative to the width (not height):
http://www.w3.org/TR/CSS2/box.html#margin-properties
see margin-top / margin-bottom section

So, unless you happen to have the exact same height and width you'll get some very unexpected results.

I have an example here. You have to scroll to the bottom and see the gold and green box:
http://codepen.io/roblevin/pen/szavA?editors=110

But here's that code snippet for convenience:
<div style="overflow: auto; height: 100px; margin-top: 2em; border: 0; padding: 0; background-color: gold; outline: 5px solid #ddd; padding: 1px;">
<p style="height: 50%; margin-top: 10%; margin-bottom: 10%; background-color: green; outline: none;">This is a paragraph. The margin-top and margin-bottom are set to 10%. Note that this will be 10% of ~800px (the width) and NOT the height of 100px. Notice the scrollbars?</p>

</div>

Rob Levin  Sep 19, 2014 
Printed Page 176
3rd paragraph

the example given for negative margins does not work in IE7. There should be a note for users of IE7
or an example that is cross browser compatible should be provided.

Anonymous   
Printed Page 176
1st paragraph

The text says that "the absolute value of the negative margin is then subtracted from the positive margin," but the preceding text does not establish that there is a positive margin; what happens if both margins are negative?

Tim Boemker  Nov 02, 2011 
Printed Page 281
Third paragraph.

body {background: white url(yinyang.gif;}

should be:

body {background: white url(yinyang.gif);}

Kristofer  Oct 29, 2009 
Printed Page 291
Figure 10-11

Float rule 8 suggests that the box labelled "4", although pushed to a new line in accordance with rule 7, should be placed just underneath box "3" and to the right of box "2" so as to be as high as possible.

The following html displays "4" below "3" and not below "1" on Firefox, Chrome, Safari, and IE 6/7/8:

<html>
<head></head>
<body>
<div style="width: 300px;">
<div style="float: left; width: 100px; height: 100px; border: 1px solid blue;">1</div>
<div style="float: left; width: 100px; height: 100px; border: 1px solid blue;">2</div>
<div style="float: left; width: 70px; height: 99px; border: 1px solid green;">3</div>
<div style="float: left; width: 40px; height: 80px; border: 1px solid red;">4</div>
<div style="float: left; width: 100px; height: 100px; border: 1px solid blue;">5</div>
</div>
</body>
</html>

Should the illustration change or have I misunderstood the conditions which push "4" below "1"?

david.barbrow  Mar 01, 2010 
Printed Page 324
bottom of page

Figure 10-46 is referenced twice, but is not present. Figure 10-45 is a third of the way down from the top of page 324, and Figure 10-47 is directly across from it on page 325, but 10-46 is nowhere to be found on either page or any preceding or subsequent pages.

Anonymous  Nov 15, 2008 
Printed Page 324
Contained in the tip, bottom half of page

Tip states: "As of this writing, no version of Internet Explorer, including IE7, supports the horizontal-centering behavior of auto top and bottom margins on absolutely positioned elements."

HORIZONTAL centering is done with LEFT and RIGHT auto margins, NOT TOP and BOTTOM margins!

John Schortz  Jan 30, 2012 
Printed Page 354
CSS below the first paragraph

Currently:
The border-spacing property is in the td element.
A #squeeze ID selector is defined on a td element

What it should be:
The border-spacing property should be in the table element, not the td element.
There should be some html that references id="squeeze" since image 11-7 shows cell
two being "squeezed". The html on page 353 would do, if <td>cell two</td> were
replaced by: <td id="squeeze">cell two</td>

Anonymous   
Printed Page 371
CSS2 values

It's actually the errata online that has this error. Currently, the errata states:

(371)

In the "CSS2.1 values" portion of the property box, the following items have been added:

" | katakana-iroha"

after

"hiragana-iroha | "

You need to change "CSS2.1" to "CSS2."

Thanks!

Anonymous  Aug 11, 2008 
PDF Page 646
"Had we declared growth factors" ...

quote from book:

"Had we declared growth factors of 0.1,
0.1, and 0.3, or 25, 25, and 75, or really any combination of numbers with a 1:1:3 correspondence, the result would have been identical."

..there are actually several examples in the text (both "CSS - The Definitive Guide (4th edition)" and "Flexbox in CSS") that indicate using flex grow factors for all items in a flex line that are less than one will behave the same as though all of these factors were multiplied by a constant factor that would increase all of their values to be greater than one.

However, according to spec.. this is not the actual behavior:

https://www.w3.org/TR/css-flexbox-1/#resolve-flexible-lengths
section: "9.7. Resolving Flexible Lengths"

for a simple example:
* begin with:
https://rawgit.com/estelle/flexbox/master/flexfiles/31_flexgrow.html
* edit the first flex container:
article:first-child > div > div:last-child {flex-grow: 0.5}
* result:
the last flex item grows, but only by half of the initial free space

Warren Bank  Dec 26, 2017