|
} /*表示沿Y轴重复图片"pendant.gif",其余部分以红色为背景色*/ background-attachment属性表示在滚动整个文档时,背景图片的显示方式。它的属性值有两种:fixed和scroll,fixed相当于IE4里的水印效果,也就是说在拖动文档时,背景相对是静止的,scroll则和文档一起滚动。
background-position属性用来指定背景图片显示的位置: 属性名称: 'background-position' 属性值: [<percentage> | <length> ]{1,2} | [top | center | bottom] || [left | center | right] 初始值: 0% 0% 适合对象: 容器元素 是否继承: no 百分比备注: refer to the size of the element itself 其中属性值含义为: "top left"和"left top"表示"0% 0%"。 "top"、"top center"和"center top"表示"50% 0%"。 "right top"和"top right"都表示"100% 0%"。 "left"、"left center"和"center left"表示"0% 50%"。 "center"和"center center"表示"50% 50%"。 "right"、"right center"和"center right"都表示"100% 50%"。 "bottom left"和"left bottom"表示"0% 100%"。 "bottom"、"bottom center"和"center bottom"都表示"50% 100%" "bottom right"和"right bottom"表示"100% 100%"。 例如: BODY { background: url(banner.jpeg) right top } /* 100% 0% */ BODY { background: url(banner.jpeg) top center } /* 50% 0% */ BODY { background: url(banner.jpeg) center } /* 50% 50% */ BODY { background: url(banner.jpeg) bottom } /* 50% 100% */ background属性是以上背景属性的快捷方式,属性和顺序如下: 属性名称: 'background' 属性值: <'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'> 适合对象: 所有元素 是否继承: no 百分比备注: 只在background-position中容许使用
[NextPage]
字体属性
CSS属性: 5、字体(Font)属性:
这里定义了关于字体的各种属性。 font-family属性定义字体的名称,可以是一个字体的名称,也可以是一类字体的名称,字体的名称一定要和计算机系统里的完全一样: 属性名称: 'font-family' 属性值: [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] 初始值: 根据用户定义而定 适合对象: 所有元素 是否继承: yes 百分比备注: 被禁止 有些计算机系统里如果没有样式单要求的字体,可以再设一个次字体以备万一。例如: BODY { font-family: Baskerville, "Heisi Mincho W3", Symbol, serif } family-name是指确定的某字体,如Heisi Mincho W3,generic-family指某一类字体,如serif。 font-style属性描述字体的倾斜程度: 属性名称: 'font-style' 属性值: normal | italic | oblique 初始值: normal 适合对象: 所有元素 是否继承: yes 百分比备注: 被禁止
font-variant属性: 属性名称: 'font-variant' 属性值: normal | small-caps 初始值: normal 适合对象: 所有元素 是否继承: yes 百分比备注: 被禁止 一个使用了small-caps属性的元素中的小写字母看起来要比正常的大写字母小一些。
font-weight属性用来描述字重。 属性名称: 'font-weight' 属性值: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 初始值: normal 适合对象: 所有元素 是否继承: yes 百分比备注: 被禁止 100到900代表9种不同的字重,400代表normal,700代表bold,900是最重的字体,bolder或lighter表示字体的字重比父元素高或低一级,比如父元素字重为400,则bolder代表字重500,如果父元素本身字重为900,那么bolder后,字重还是900,同样的lighter也一样。有些字体并没有100到900那么全的字重,也许是从300到700,那么字重的最小和最大值也为300到700。例如:
|