老师请检查
来源:2-18 编程练习
brown_one
2020-08-19 16:23:24
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>background-image</title>
<style type="text/css">
/*此处写代码*/
div{
width:1000px;
height:300px;
background:
url("http://climg.mukewang.com/582c3b780001a95103000090.jpg") no-repeat center 0,
url("http://climg.mukewang.com/582c3b6d0001197603000090.jpg") no-repeat center 100px,
url("http://climg.mukewang.com/582c3b61000122dd03000090.jpg") no-repeat center 200px;
background-size:300px 90px;
background-attachment:fixed;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div></div>
</body>
</html>
问题1:为什么去掉 background-attachment:fixed;后就不显示了
问题2:请老师看一下有无改正的地方
1回答
好帮手慕粉
2020-08-19
同学你好,关于同学的问题回答如下:
1、老师去掉background-attachment:fixed后,是可以正常显示的:
同学可以再测试下。
2、background-attachment是设置背景图像是否固定或者随着页面的其余部分滚动,background-attachment:fixed是设置图像不随页面的其余部分滚动,例如:
当页面向下滚动时,背景图片的位置不会发生变化。所以这个属性跟题目是没有关系的,建议同学去掉。
如果我的回答帮助了你,欢迎采纳。祝学习愉快~
相似问题