HTML and CSS Reference
In-Depth Information
The shorthand property lets you specify one to four lengths. The next
diagram shows a practical example:
padding: 20px 30px;
border-width: 10px;
margin: 20px 30px 40px 20px;
If just one length is given, all four top,
left, bottom, and right are set to that
width. Two lengths set the top and bot-
tom widths to the first value and the left
and right to the second value. If three
lengths are given, the first and last val-
ues set the top and bottom, and both left
and right are set to the second value.
Finally, four values are applied in the
order top, right, bottom, left.
Quirks mode and Standards mode
In the late 1990s, there was a lot of confusion about the correct way to
implement CSS . This was particularly apparent in the way different
browsers treated the box model. By the time understanding of the spec
stabilized, several browsers were using incorrect approaches. Worse,
many websites had been created that depended on the incorrect
approach; when the designer is trying to make everything line up
exactly, a difference of a few pixels in width is very visible.
As new browsers were released, they wanted to implement the correct
behavior, but they didn't want to break the web by making all websites
follow the new rule. To solve the problem, vendors created two render-
ing modes in their new browsers:
Standards mode —The browser displays according to the current stan-
dards, as far as they're understood and can be implemented by the
Quirks mode —The browser displays according to the incorrect rules
implemented by previous versions of that browser.
Search WWH ::

Custom Search