当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS background-position属性

CSS
CSS2 Aural
CSS 单位
CSS 颜色
CSS 颜色值
CSS 颜色名称
CSS 编码与组织技巧
CSS 模块化设计思路
CSS完美兼容IE6/IE7/FF的通用方法
CSS @ Ten: 下一个重要的东西

CSS background-position属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 330 ::
收藏到网摘: n/a

The background-position property sets the starting position of a background image.
background-position属性可设置背景图像位置

继承性:

举例

body

background-image: url(stars.gif);
background-repeat: no-repeat;
background-position: top left
}

body

background-image: url(stars.gif);
background-repeat: no-repeat;
background-position: 0% 0%
}

可用的值

描述
top left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right
If you only specify one keyword, the second value will be "center".
如果你只指定了一个关键字,那么第二个值将会是"center"
x-% y-% The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%.
第一个值影响水平位置,第二个值影响垂直位置。左上角就为0% 0%。右下角则为100% 100%。如果你只指定了其中的一个值,那么另一个值会是50%
x-pos y-pos The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positions.
第一个值影响水平位置,第二个值影响垂直位置。左上角就为0 0。单位可以是像素(0px 0px)或是其他的CSS单位。如果你只指定了一个值,那么另一个值会是50%你可以把%和位置名称混合使用。

评论 (0) All

登陆 | 还没注册?