关键字解释如下: 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% 注意:参数中的center如果用于另外一个参数的前面,表示水平居中;如果用于另外一个参数的后面,表示垂直居中。
6. 背景样式:background
语法:{background:背景颜色|背景图象|背景重复|背景附件|背景位置} 作用:背景属性是一个更明确的背景—关系属性的略写。以下是一些背景的声明: 例子: BODY { background: white url(http://www.yidi.net/logo.gif) } BLOCKQUOTE { background: #7fffd4 } P { background: url(../backgrounds/pawn.png) #f0f8ff fixed } TABLE { background: #0c0 url(leaves.jpg) no-repeat bottom right } 注意:当一个值未被指定时,将接受其初始值。例如,在上述的前三条规则,背景位置属性将被设置为0% 0%。为了避免与用户的样式表之间的冲突,背景和颜色应该一起被指定。