4-3編程練習
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> *{ padding:0;margin:0; } .logo{ width: auto; height: 4000px; background: url(http://img1.sycdn.imooc.com/climg//59c9f7ce0001839219034033.png) no-repeat center; } .javaicon{ width: 200px; height: 50%; background: url(http://img1.sycdn.imooc.com/climg//5a3383c70001f1b702240364.png) no-repeat center; position: fixed; right:0; top:50%; margin-top:-180px; } .webicon{ width: 200px; height: 50%; background: url(http://img1.sycdn.imooc.com/climg//5a3383d00001a3dd02240364.png) no-repeat center; position: fixed; left:0; top:50%; margin-top:-180px; } </style> </head> <body> <div class="logo"> <div class="content"> <div class="javaicon"></div> <div class="webicon"></div> </div> </div> </body> </html>
0
收起
正在回答
1回答
你好同学,左右两边的盒子高度有一点大,背景图铺不满。建议改为固定高度更好:
如下调整:
祝学习愉快,望采纳。
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星