element is generated using margins. Therefore, if you don'tdeclare margins for the P element, the browser mayapply some margins on its own -- which is to say that just becauseyou don't declare margins for an element doesn't meanthat there won't be any.You can also declare a margin to be auto. For now,assume that auto will get you an automaticallycalculated value, which is usually, but not quite always, zero.
Note in Figure 6-12 that the text color next to thecheckboxes is still black. This is because we've only assignedstyles to elements like INPUT andSELECT, not normal paragraph (or other) text.
One limitation under CSS1 is that there isn't a way todistinguish between different types of INPUTelements. If you need to have checkboxes be a different color thanradio buttons, then you'll need to assign them classes so thatyou get the desired result (seen in Figure 6-13):
need to put some thought into it first. That's generally true
in any case, but with colors, it's even more so. For example,
if you're going to set all hyperlinks to be yellow, will that
clash with the background color in any part of your document? If you
use too many colors, will the user be too overwhelmed? If you change
the default hyperlink colors, will users still be able to figure out
where your links are? If you set both regular text and hyperlink text
to be the same color, for instance, then it will be much harder to
spot links -- in fact, almost impossible if the user's links
aren't underlined.
WARNING
Percentage values refer to the width of the parent element.
These propertiesoperate as you'd expect by now. For example, the following tworules will give the same amount of padding:
Figure 8-21. Examples of negative vertical margins
You'll notice the "pulling" effect of negative topand bottom margins. This is really no different from the way in whichnegative horizontal margins cause an element to push outside of itsparent. Consider:
As we can see from Figure 8-22, the paragraph hassimply been pulled upward by its negative top margin, such thatit's outside the parent DIV !