请老师检查下代码 多谢!
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> *{ padding: 0; margin: 0; } body{ min-height: 700px; } ul{ list-style-type: none; } a{ color: #fff; text-decoration: none; } .header{ width: 100%; height: 100px; overflow: hidden; background-color: #000; position: fixed; float: left; z-index: 9999; } .header img{ display: block; } .img{ float: left; } .nav{ float: right; color: #fff; padding: 0 20px; } .nav ul li{ display: inline-block; line-height: 100px; margin: 0 20px; font-size: 20px; } .nav ul li :hover{ color: orange; } .center,.left,.right{ min-height: 1100px; position: relative; float: left; } .middle{ padding: 100px 350px; height: 1100px; } .center{ background-color: #ffb8c4; width: 100%; text-align: center; padding: 200px 0 0 0; } .center img{ display: inline-block; } .left{ background-color: #ffecd8; width: 350px; margin-left: -100%; left: -350px; } .left div{ margin: 20px; } .left div span{ background-color: pink; } .title{ font-size: 30px; font-weight: bold; } .right{ background-color: #9ed3e1; width: 350px; margin-left: -350px; right: -350px; } .right div{ margin: 20px; } .right ul li{ margin: 20px; } input{ height: 40px; width: 300px; border: none; } .button{ background-color: red; border: 0; color: #fff; font-size: 20px; } .footer{ width: 100%; height: 100px; background-color: #000; position: fixed; bottom: 0; text-align: center; float: left; z-index: 9999; } .footer ul li{ display: inline-block; color: #fff; line-height: 100px; font-size: 20px; margin: 0 40px; } </style> </head> <body> <div class="container"> <div class="header"> <div class="img"> <a href="#"><img src="http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png"/></a> </div> <div class="nav"> <ul> <li><a href="#">课程</a></li> <li><a href="#">职业路径</a></li> <li><a href="#">实战</a></li> <li><a href="#">猿问</a></li> <li><a href="#">手记</a></li> </ul> </div> </div> <div class="middle"> <div class="center"> <img src="http://img1.sycdn.imooc.com/climg//590037e00001fab706000400.jpg"/> </div> <div class="left"> <div class="title">课程推荐</div> <div><span>职业路径</span> HTML5与CSS3实现动态网页</div> <div><span>职业路径</span> 零基础入门Android语法与界面</div> <div><span>职业路径</span> ios基础语法与常用控件</div> <div><span>职业路径</span> PHP入门开发</div> <div><span>职业路径</span> JAVA入门开发</div> </div> <div class="right"> <div class="title">登录</div> <ul> <li><input type="text" name="username" placeholder="请输入登录邮箱/手机号" /></li> <li><input type="password" name="password" placeholder="6-16位密码,区分大小写,不能用空格" /></li> <li><input class="button" type="button" name="login" value="登录" /></li> </ul> </div> </div> <div class="footer"> <ul> <li><a href="#">网站首页</a></li> <li><a href="#">企业合作</a></li> <li><a href="#">人才招聘</a></li> <li><a href="#">联系我们</a></li> <li><a href="#">常见问题</a></li> <li><a href="#">友情链接</a></li> </ul> </div> </div> </body> </html>
8
收起
正在回答
2回答
同学你好,左右两侧的高度与中部不一样。建议给left 和right添加padding:200px 0。
祝学习愉快~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星