This page is for corrections to the book XHTML Essentials by Michael Sauers and R. Allen Wyke, published by John Wiley & Sons in September 2001.
ISBN 0-471-41764-5
X H T M L
E s s e n t i a l s
This page is for corrections to the book XHTML Essentials by Michael Sauers and R. Allen Wyke, published by John Wiley & Sons in September 2001.
ISBN 0-471-41764-5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
'margin' Value: <margin-width> {1,4} | inheritThis means that 'margin:' may take between one and four values, inclusive.
If there is only one value, it applies to all sides.Simple enough, right?
If there are two values, the top and bottom margins are set to the first value and the right and left margins are set to the second.IOW, a definition 'margin:0 0;' such as the original poster used means, 'make the vertical margins nil and the horizontal margins nil.' (Yes, it's really as redundant as it looks. A better example might be, 'margin: 0 20px;', which says 'make the vertical margins nil, but give 20px space on *both* the left and right sides'.)
If there are three values, the top is set to the first value, the left and } right are set to the second, and the bottom is set to the third.This one, for me at least, is the toughy. I can never remember which is which. The next one, actually, may be helpful:
If there are four values, they apply to the top, right, bottom, and left respectively.For those of you who know your compass or your clock, this is simply clockwise round the block. And for the three-value version, just remember that you're doing both sides at once, the first time round, so it's top, right/left, bottom. (Or you could remember it the way someone once tried to teach me the compass: remember NEWS (or Never Eat Shredded Wheat, which I think is a bit before my time): North (top), East/West (right/left), South (bottom).)
©2002, Michael Sauers
Last Updated: Last modified 01/23/2020 17:35:00