4-3编程
来源:4-2 侧边栏导航跟随案例
慕斯6639037
2017-10-22 21:04:36
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <style type="text/css"> *{ margin: 0px; padding: 0px; } .page{ background: url("http://climg.mukewang.com/59c9f7ce0001839219034033.png") center top no-repeat; width: 100%; height:4043px; } .left{ background:url("http://ww1.sinaimg.cn/mw690/6f8ccb76gy1fjy8p0qpkxj20cg0k8tet.jpg"); background-size:200px 260px; width:200px; height:260px; position:fixed; left:0; top:50%; margin-top:-130px; } .right{ background:url("http://ww1.sinaimg.cn/mw690/6f8ccb76gy1fjy8ozkvuqj20ce0k6wng.jpg"); background-size:200px 260px; width:200px; height:260px; position:fixed; right:0; top:50%; margin-top:-130px; } </style> </head> <body> <div class="page"> <div class="left"></div> <div class="right"></div> </div> </body> </html>
老师看看对不对?
1回答
好帮手慕糖
2017-10-23
你好,左右两侧的位置实现的是没有问题的,但是建议:这两个块李里面的内容可以自己书写下哟。不建议直接使用图片。
祝学习愉快~