TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
background-attachment -- 定义背景图片随滚动轴的移动方式
取值: scroll | fixed | inherit
scroll: 随着页面的滚动轴背景图片将移动
fixed: 随着页面的滚动轴背景图片不会移动
inherit: 继承 例子:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>CSS background-attachment 属性示例</title>
<style type="text/css" media="all">
body {
background-image:url("images/list-orange.png");
background-attachment:fixed;
background-repeat:repeat-x;
background-position:center center;
position:absolute;
height:5000px;
}
</style>
</head>
<body>
<span>CSS学习: background-attachment</a><br>
取值: scroll | fixed | inherit <br />
scroll: 随着页面的滚动轴背景图片将移动 <br />
fixed: 随着页面的滚动轴背景图片不会移动 <br />
inherit: 继承 <br>
示例,拖动滚动条,并且注意中间有一条橙色线并不会随滚动条的下移而上移.</span>
</body>
</html>
源码下载:http://file.javaxxz.com/2014/11/2/235518921.zip |
|