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

CSS
CSS 介绍
CSS 语法
使用 CSS
CSS 背景
CSS 文字
CSS 字体
CSS 边框
CSS 边距
CSS 填充
CSS 列表
CSS 尺寸
CSS 类别
CSS 定位
CSS 伪类
CSS 伪元素
CSS2 Media类型
CSS 摘要
CSS 实例
CSS2 参考资料
CSS2 打印

CSS background-position属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 329 ::
收藏到网摘: 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

登陆 | 还没注册?