我这代码显示的背景图没有原图的全 是因为我屏幕宽比原图宽小吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin:0;
padding:0;
}
.con{
width:100%;
height:4000px;
}
.wrap{
width:100%;
height:4043px;
background:url("http://img1.sycdn.imooc.com/climg//59c9f7ce0001839219034033.png") top center no-repeat;
/*background-color:#444;*/
}
.nav-left{
width:200px;
height:200px;
background:url("http://img1.sycdn.imooc.com/climg//5a3383c70001f1b702240364.png") top center no-repeat;
position:fixed;
top:50%;
left:0;
margin-top:-100px;
}
.nav-right{
width:200px;
height:200px;
background:url("http://img1.sycdn.imooc.com/climg//5a3383d00001a3dd02240364.png") no-repeat;
position:fixed;
top:50%;
right:0;
margin-top:-100px;
}
</style>
</head>
<body>
<div class="con">
<div class="wrap">
<div class="nav-left"></div>
<div class="nav-right"></div>
</div>
</div>
</body>
</html>
正在回答
是的!。。
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星