2-6编程,为什么我footer这样设置样式后,最后一张图片和footer内的内容都没有了?
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{ margin:0; padding:0; } ul{ list-style:none; } a{ text-decoration:none; } img{ width:100%; } .img1{ padding-top: 100px; } .nav{ width: 100%; height: 100px; background: black; position: fixed; /*top: 0;*/ /*bottom: 0;*/ left:0; right: 0; margin:0 auto; } .logo{ float:left; } .nav-ul{ float:right; } .nav-li{ float:left; line-height:100px; padding:0 10px; } .footer{ height: 100px width: 100%; background: black; position: fixed; } .footer-ul{ left:0; right: 0; margin:0 auto; } .footer-li{ float: left; line-height:100px; padding:0 10px; } </style> </head> <body> <div class="nav"> <div class="logo"> <a href="#"><img src="http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png"></a> </div> <ul class="nav-ul"> <li class="nav-li"><a href="#">课程</a></li> <li class="nav-li"><a href="#">职业路径</a></li> <li class="nav-li"><a href="#">实战</a></li> <li class="nav-li"><a href="#">猿问</a></li> <li class="nav-li"><a href="#">手记</a></li> </ul> </div> <div class="banner"> <img class="img1" src="http://img1.sycdn.imooc.com/climg//58c0eda50001e12416000480.jpg" > <img src="http://img1.sycdn.imooc.com/climg//58c0edb80001c9f216000480.jpg" > <img src="http://img1.sycdn.imooc.com/climg//58c0edc9000100d516000480.jpg" > </div> <div class="footer"> <ul class="footer-ul"> <li class="footer-li"><a href="#">网站首页</a></li> <li class="footer-li"><a href="#">企业合作</a></li> <li class="footer-li"><a href="#">人才招聘</a></li> <li class="footer-li"><a href="#">联系我们</a></li> <li class="footer-li"><a href="#">常见问题</a></li> <li class="footer-li"><a href="#">友情链接</a></li> </ul> </div> </body> </html>
如题。谢谢老师
16
收起
正在回答 回答被采纳积分+1
2回答
ghy3030
2017-09-11 10:43:03
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{ margin:0; padding:0; } ul{ list-style:none; } a{ text-decoration:none; } img{ width:100%; } .img1{ padding-top: 100px; } .nav{ width: 100%; height: 100px; background: black; position: fixed; /*top: 0;*/ /*bottom: 0;*/ left:0; right: 0; margin:0 auto; } .logo{ float:left; } .nav-ul{ float:right; } .nav-li{ float:left; line-height:100px; padding:0 10px; } .footer{ height: 100px; width: 100%; background: black; position: fixed; bottom:0; } .footer-ul{ left:0; right: 0; top:0; bottom: 0:; margin:auto auto; /*text-align: center;*/ } .footer-li{ float: left; line-height:100px; padding:0 10px; } </style> </head> <body> <div class="nav"> <div class="logo"> <a href="#"><img src="http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png"></a> </div> <ul class="nav-ul"> <li class="nav-li"><a href="#">课程</a></li> <li class="nav-li"><a href="#">职业路径</a></li> <li class="nav-li"><a href="#">实战</a></li> <li class="nav-li"><a href="#">猿问</a></li> <li class="nav-li"><a href="#">手记</a></li> </ul> </div> <div class="banner"> <img class="img1" src="http://img1.sycdn.imooc.com/climg//58c0eda50001e12416000480.jpg" > <img src="http://img1.sycdn.imooc.com/climg//58c0edb80001c9f216000480.jpg" > <img src="http://img1.sycdn.imooc.com/climg//58c0edc9000100d516000480.jpg" > </div> <div class="footer"> <ul class="footer-ul"> <li class="footer-li"><a href="#">网站首页</a></li> <li class="footer-li"><a href="#">企业合作</a></li> <li class="footer-li"><a href="#">人才招聘</a></li> <li class="footer-li"><a href="#">联系我们</a></li> <li class="footer-li"><a href="#">常见问题</a></li> <li class="footer-li"><a href="#">友情链接</a></li> </ul> </div> </body> </html>
非常感谢老师的解答,问题基本解决。但又出现了一个小小的问题,footer里面的文字无法居中,请老师再麻烦解答下,谢谢!
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星