CSSµÄ±ß½çÖØµþ¹æÔò
In this specification, the expression collapsing margins means that adjoining margins (no non-empty content, padding or border areas or clearance separate them) of two or more boxes (which may be next to one another or nested) combine to form a single margin.
In CSS 2.1, horizontal margins never collapse.
Vertical margins may collapse between certain boxes:
Two or more adjoining vertical margins of block boxes in the normal flow collapse. The resulting margin width is the maximum of the adjoining margin widths. In the case of negative margins, the maximum of the absolute values of the negative adjoining margins is deducted from the maximum of the positive adjoining margins. If there are no positive margins, the absolute maximum of the negative adjoining margins is deducted from zero. Note. Adjoining boxes may be generated by elements that are not related as siblings or ancestors.
Vertical margins between a floated box and any other box do not collapse (not even between a float and its in-flow children).
Vertical margins of elements that establish new block formatting contexts (such as floats and elements with 'overflow' other than 'visible') do not collapse with their in-flow children.
Margins of absolutely positioned boxes do not collapse (not even with their in-flow children).
Margins of inline-block elements do not collapse (not even with their in-flow children).
If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it. In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved. The position of the element's top border edge is the same as it would have
Ïà¹ØÎĵµ£º
ÍⲿÒýÓÃCSS
ÖÐ link
Óë@import
µÄÇø±ð
ÕâÁ½ÌìдÁËCSSÑùʽ£¬¾ßÌåÑо¿ÁËXHTML¼ÓÔØCSS
µÄ¼¸ÖÖ·½Ê½£¬ÆäÖÐÍⲿÒýÓÃCSS
·ÖΪÁ½ÖÖ·½Ê½link
ºÍ@import
¡£
±¾ÖÊÉÏ£¬ÕâÁ½ÖÖ·½Ê½¶¼ÊÇΪÁ˼ÓÔØCSS
Îļþ£¬µ«»¹ÊÇ´æÔÚ×Åϸ΢µÄ²î±ð¡£
* ²î±ð1£ºÀÏ׿×ڵIJî±ð¡£link
ÊôÓÚXHTML±êÇ©£¬¶ø@import
ÍêÈ«ÊÇCSS
Ìá¹ ......
<div class="llist" >
<div class="lbar">¶¨ÏòÓªÏú</div>
<ul class="lbox01" style="height: auto;min-height: 100px;">
<c:forEach var="item" items="${marketInfos.results}">
<li><div style="overflow:hidden; text-overfl ......
IE6 IE7 IE8 Firefox Opera Google
·¶Àý
>
Y
Y
N
N
N
N
.type { >color: #F00; }
.
Y
Y
N
N
N
N
.type { .color: #F00; }
*
Y
Y
N
N
N
N
.type { *color: #F00; }
_
Y
N
N
N
N
N
.type { _color: #F00; }
!important
N
Y
Y
Y
......
.styleName{
color
:
#FFF
;
/* FF,OP,IE8 */
[
;
color:
#0F0
;
]
/* Sa,CH */
*
color
:
#FF0
;
/* IE7 */
_color:
#F00
;
/* IE6 */
}
.styleName{
background-color
:
#332200
;
/* FF*/
}
html*
.styleName{
background-color
:
#FF00FF
;
/* Sa IE7 CH */
}
*+
html .style ......