1. 程式人生 > 其它 >2021/10/29 導航

2021/10/29 導航

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/head.css"/>
</head>
<body>
<div class="head">
<div class="line1">
<span class="log">
<img src="img/img/logo/yinLogo.png" >
</span>
<ul>
<li><a href="#">購物須知</a></li>
<li><a href="#">購物須知</a></li>
<li><a href="redaing.html">購物須知</a></li>
</ul>
</div>

<div class="line2">
<span class="log">
<img src="img/img/logo/shop-logo-v1.png" >
</span>
<div>
<input type="text" class="search">
<span class="btr"></span>
</div>
<ul>
<li><img src="./img/img/icon/avatar.png" ><a href="login.html">登入</a></li>
<li><a href="#">我的訂單</a></li>
<li><img src="img/img/icon/cart-logo-v1.png" ><a href="#">購物車</a></li>
</ul>
</div>
<hr >
<div class="line3">
<span class="title"><a href="#">藝人分類</a></span>
<ul>
<li><a class="active" href="#" target="_top">首頁</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>
<li><a href="#">食品</a></li>
<li><a href="#">服裝配飾</a></li>
</ul>
</div>
</div>
</body>
</html>

body{
margin: 0px;
}
.head{
background-color: #222;
}
.head ul{
padding-left: 0px;
}
.head ul li{
display: inline-block;
}
.head a{
text-decoration: none;
color: #CCCCCC;
display: block;
}
.head .line1{
background-color: #111;
display: flex;
justify-content: space-between;/* 中間全空 兩端對齊 */
align-items: center;/* 元素垂直居中 */
}
.head .line1 .log{
margin-left: 100px;
}
.head .line1 ul{
margin-right: 100px;
}
.head .line1 ul li{
width: 150px;
border-right: 1px solid #999999;
text-align: center;
}
.head .line1 ul li a{
color: #999999;
}
.head .line1 ul li:last-child{
border: none;
}


.head .line2{
width: 1000px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.head .line2 div{
position: relative;
}
.head .line2 .search{
color: #FFFFFF;
font-size: 16px;
display: inline-block;
width: 435px;
height: 40px;
border: none;
background: url(../img/img/icon/search_icon.png);
background-position: 0 -43px;
outline: none;
padding-left: 18px;
}
.head .line2 .btr{
display: inline-block;
height: 40px;
width: 20px;
background-color: white;
position: absolute;
background: url(../img/img/icon/search_icon.png);
background-position: 27px -84px;
right: 20px;
}
.head .line2 .search:focus{
background-position: 0px 1px;
color: #333333;
}
.head .line2 .search:focus + .btr{
background-position: 22px -43px;
}
.head .line2 ul li a{
display: inline-block;
}
.head .line2 ul li{
margin: 0px 15px;
}
.head .line2 ul li img{
display: inline-block;
height: 24px;
width: 24px;
vertical-align: middle;/* 中間居中 */
margin-right: 10px;
}
.head hr{/* hr是由兩個邊框決定的*/
border: none;
border-bottom: 1px solid #999999;
margin-bottom: 0px;
}
.head .line3{
width: 1000px;
margin: 0px auto;
display: flex;
justify-content: space-between;
align-items: center;/* 垂直居中 */
}
.head .line3 .title a{
display: block;
background-color: #000000;
line-height: 53px;
width: 120px;
text-align: center;
}
.head .line3 ul{
margin: 0px;
}
.head .line3 li{
width: 90px;
text-align: center;
line-height: 53px;
}
.head .line3 li a:hover{
color: #DE4767;
border-bottom: 4px solid #DE4767;
line-height: 45px;
}
.head .line3 .active{
color: #DE4767;
border-bottom: 4px solid #DE4767;
line-height: 45px;
}