摘要:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>淘宝导航</title><link rel="stylesheet" type="text/css" href="css/index.css
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>淘宝导航</title> <link rel="stylesheet" type="text/css" href="css/index.css"> <link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css"> </head> <body> <div> <div> <div> <a href="">中国大陆 <i class=" fa fa-angle-down"></i></a> <a href="" style="color:#f22e00">亲,请等登录</a> <a href="">免费注册</a> <a href="">手机逛淘宝</a> </div> <div> <a href="">我的淘宝 <i class=" fa fa-angle-down"></i></a> <a href=""><span class=" fa fa-cart-plus"></span> 购物车 <i class=" fa fa-angle-down"></i></a> <a href=""><span class=" fa fa-heart-o"></span> 收藏夹 <i class=" fa fa-angle-down"></i></a> <a href="">商品分类</a> <a href="">卖家中心 <i class=" fa fa-angle-down"></i></a><a href="">联系客服 <i class=" fa fa-angle-down"></i></a> <a href=""><span class=" fa fa-navicon (alias)"></span> 网站导航 <i class=" fa fa-angle-down"></i></a> </div> </div> <div></div> </div> </body> </html> *{margin:0px;padding: 0px;} .clear{clear:both;} .header{ width:100%; height:35px; background: #F5F5F5; } .header_content{ width:1190px; height:35px; margin:0px auto; line-height: 35px; } .header_left{ width:400px; height:35px; float:left; } .header a{ text-decoration: none; color:#3C3C3C; margin:0px 7px; font-size: 12px; } .header a:hover{ color:#f22e00; } .header_a{ display: inline-block; width:80px; height:35px; text-align: center; } .header_a:hover{ background: #fff; } .header_right{ width:750px; height:35px; float:right; text-align: right; }
如果不清楚浮动的话,很容易出现错误
行内元素一定要转化为块内元素或者行内块元素才可以设置width,height属性
批改老师:韦小宝批改时间:2018-11-21 09:08:19
老师总结:代码写的很完整!不错!两行总结也很到位没毛病!继续加油吧!