易截截图软件、单文件、免安装、纯绿色、仅160KB

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样式相关知识小结

可以放置样式的地方:样式表,<style>和style
样式表是一个独立的文件,可以通过<link>元素或者css的@import语句把它附加到某个html文档中,<style>是一个html元素,可以把它内嵌在html文档中,style是一个属性,可以内置在任何html元素中。
要想把样式表连到html文档中,要在html文档中的<head> ......

13种常用按钮、文本框、表单等CSS样式

虽然CSS样式的学习需要我们动手多实践,需要多做案例,思致思考,但有时候注意资料的收集与整理也是非常重要的,在实际开发中往往会起到事半功倍的效果。下面一些关于按钮、文本框、表单的常用CSS样式。大家可以参考。
一、按钮样式
.buttoncss {
    font-family: "tahoma", "宋体" ......

css選擇符大雜燴

 
类型选择符:单指元素的名字,而没有大于号和小于号
类选择符:选择所有赋有相同类的元素 一个点号后面跟类名,类选择符要跟着类名的后面。 可以把加在通配符*的后面来选择文档中所有赋予该类的元素,
Id 选择符
 
群组选择符:多个选择符用逗号连起来
后代选择符:多个选择符用空白连起来
子选择符:多 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号