麻烦老师看下代码,导航居中显示有点问题,谢谢
相关代码:html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>慕云游商城 - 机票、酒店、旅游攻略</title>
<meta name="Keywords" content="机票,酒店,旅游攻略,签证,出国,自由行">
<meta name="Description" content="慕云游商城有10多年旅游行业经验,为您提供全方位旅游服务">
<link rel="stylesheet" href="css/rest.css">
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<!-- 网页顶部 -->
<header class="site-head">
<div class="topbar">
<div class="center-wrap">
<nav class="shortcut-links">
<ul>
<li>
<a href="">目的地</a>
</li>
<li>
<a href="">锦囊</a>
</li>
<li class="have-menu">
<a href="">社区</a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li>
<a href="">行程助手</a>
</li>
<li class="have-menu">
<a href="">商城</a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li class="have-menu">
<a href="">酒店.民宿</a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li>
<a href="">特价酒店</a>
</li>
</ul>
</nav>
</div>
</div>
</header>
</body>
</html>
相关代码:css.css
.site-head{
height: 150px;
}
.site-head .topbar{
height: 32px;
background-color:#2A2A2A;
line-height: 32px;
}
.site-head .topbar a{
color: white;
}
.site-head .topbar .shortcut-links{
float: left;
}
.site-head .topbar .shortcut-links ul li{
float:left;
margin-right: 18px;
font-size: 14px;
}
.site-head .topbar .shortcut-links ul li.have-menu{
padding-right:12px;
position: relative;
}
.site-head .topbar .shortcut-links ul li.have-menu .arrow{
position: absolute;
right:0;
top: 50%;
margin-top: -6px;
width: 12px;
height: 12px;
transition: transform .2s ease 0s;
}
.site-head .topbar .shortcut-links ul li.have-menu:hover .arrow{
transform: rotate(180deg);
}
.site-head .topbar .shortcut-links ul li.have-menu .arrow b{
position: absolute;
top: 2px;
left: 3px;
width: 6px;
height: 6px;
background-color:white;
transform: rotate(45deg);
}
.site-head .topbar .shortcut-links ul li.have-menu .arrow i{
position: absolute;
left: 3px;
top:0.5px;
width: 6px;
height:6px;
background-color:#2A2A2A;
transform: rotate(45deg);
}
相关代码:base.css
@font-face{
font-family: "PIngFangSCRegular";
src:url(../fonts/PingFangSCRegular.ttf) format('truetype')
}
body{
font-family: "PIngFangSCRegular";
}
.center-wrap{
width: 1152px;
margin: 0 auto;
}
.clearfix{
overflow: hidden;
}
.clearfix::after{
content: '';
display: block;
clear: both;
overflow: hidden;
}
.db{
display: block;
}
.dib{
display: inline-block;
}
.tac{
text-align: center;
}
相关代码:rest.css
/*
YUI 3.18.1 (build f7e7bcb)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;*font-size:100%}legend{color:#000}#yui3-css-stamp.cssreset{display:none}a{text-decoration: none;}
14
收起
正在回答 回答被采纳积分+1
2回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星