Errata

Basic Visual Formatting in CSS

Errata for Basic Visual Formatting in CSS

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. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

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

Version Location Description Submitted By Date submitted Date corrected
PDF
Page 21
first paragraph

Quote::
Since setting the top and bottom margins to auto will give them zero height,
the only way to vertically center the element in this particular case would be to
set them both to 25% -- and event then, the box would be centered, not the content within it.
::End of quote

It turns out the box is not vertically centered by setting margin-top and margin-bottom to 25%.
Here is my test code, tested in firefox 48 and chrome 53.


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Html page</title>
<style>
div {
width: 500px;
height: 6em;
border: 3px solid black;
background: red;
}

p {

margin-bottom: 25%;
height: 50%;
margin-top: 25%;
background: green;
}
</style>
</head>

<body>
<div>
<p>Hello</p>
</div>
</body>
</html>

Note from the Author or Editor:
Confirmed. I submitted corrected text via Atlas.

ling  Sep 04, 2016 
PDF
Page 27
2nd paragraph of text (not code)

quote::
Now let’s consider an example where the margins of a list item, an unordered list, and a paragraph are all collapsed. In this case, the unordered list and paragraph are assigned negative margins:
::endQuote

I believe the author meant

Now let’s consider an example where the margins of a list item, an unordered list, and a header1 are all collapsed. In this case, the unordered list and header1 are assigned negative margins:

Note from the Author or Editor:
The text:

“Now let’s consider an example where the margins of a list item, an unordered list, and a paragraph are all collapsed. In this case, the unordered list and paragraph are assigned negative margins:”

…should instead be:

“Now let’s consider an example where the margins of a list item, an unordered list, and a heading are all collapsed. In this case, the unordered list and heading are assigned negative margins:”

ling  Sep 05, 2016