请问一下这两种html加css的代码写法哪个好?或者说哪个产生bug的可能性少一点第一种:<!DOCTYPE html><html><head><meta charset="UTF-8"><script src="E:\天猫前端\js\jquery\2.0.0\jquery.min.js"></script><link href="E:\天猫前端\css\bootstrap\3.3.6\bootstrap.min.css" rel="stylesheet"><script src="D:\天猫前端\js\bootstrap\3.3.6\bootstrap.min.js"></script><link rel="stylesheet" href="E:\天猫前端\navigation.css"></head><body><nav><a href=""><div class="left"><span class="glyphicon glyphicon-home red"></span>天猫首页</div></a><span class="left">喵,欢迎来到天猫</span><a href=""><div class="left">请登录</div></a><a href=""><div class="left">免费注册</div></a><a href=""><div class="right">我的订单</div></a><a href=""><div class="right"><span class="glyphicon glyphicon-shopping-cart red"></span>购物车<strong>0</strong>件</div></a></nav></body></html>*{ margin:0;}body{ font-size:12px; font-family:Arial;}a{ text-decoration:none; color:#999999;}nav{ width:100%; height:30px; background:#f2f2f2;}nav .left{ float:left; margin-left:20px; padding:6px 0;}nav .right{ float:right; margin-right:20px; padding:6px 0;}.red{ color:#c40000;}nav a:hover{ color:red; color:#c40000;}span{ color:#999999; margin-right:5px;}第二种:<!DOCTYPE html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script src="http://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script><link href="http://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet"><script src="http://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script></head> <nav class="top "> <a href="#nowhere"> <span class="glyphicon glyphicon-home redColor"></span> 天猫首页 </a> <span>喵,欢迎来天猫</span> <a href="#nowhere">请登录</a> <a href="#nowhere">免费注册</a> <span class="pull-right"> <a href="#nowhere">我的订单</a> <a href="#nowhere"> <span class=" glyphicon glyphicon-shopping-cart redColor" ></span> 购物车<strong>0</strong>件</a> </span> </nav><style>body{ font-size: 12px; font-family: Arial;}a{ color:#999;}.redColor{ color: #C40000 !important;}nav.top{ background-color: #f2f2f2; padding-top: 5px; padding-bottom: 5px; border-bottom:1px solid #e7e7e7;}nav.top span, nav.top a{ color: #999; margin: 0px 10px 0px 10px;}nav.top a:hover{ color: #C40000; text-decoration: none;}</style>
3 回答
- 3 回答
- 0 关注
- 986 浏览
添加回答
举报
0/150
提交
取消