亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

css簡(jiǎn)單下拉效果實(shí)現(xiàn)

Original 2019-01-30 13:56:47 268
abstrakt:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>淘寶布局</title><html lang="en"><head><meta charset="

<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<title>淘寶布局</title>



<html lang="en">




<head>


<meta charset="UTF-8">


<title>淘寶布局</title>


<link rel="stylesheet" href="staic/css/font-awesome-4.7.0/font-awesome-4.7.0/css/font-awesome.min.css">


<style>

* {


margin: 0;


padding: 0;


}




a {


text-decoration: none;


color: #3C3C3C;


font-size: 12px;


}

li{

list-style: none;

}



.clear {


clear: both;


}




.header {


width: 100%;


background-color: #f5f5f5;


}




.header_content {


width: 1197px;


margin: 0 auto;


line-height: 35px;


}




.header_left {




height: 35px;


float: left;


}




.header_right {


height: 35px;


float: right;


}




.header_a {


display: inline-block;


width: 90px;


height: 35px;


text-align: center;


}




.header_a {


display: inline-block;


width: 90px;


height: 35px;


text-align: center;


}




.header_a:hover {


display: inline-block;


width: 90px;


height: 35px;


text-align: center;


background-color: #fff;

position: relative;


}






.header a {


margin-right: 5px;


}




.header a:hover {


color: #f22e00 !important;


}


.header_a ul{

border: 1px solid #f5f5f5;

display: none;

position: absolute;

width: 100px;

border-top:none;

}

.header_a:hover ul{

display: block;

}

.header_a ul li{

color: #6c6c6c;

height: 30px;

line-height: 30px;

text-align: left;

padding: 0 3px;

}

.header_a ul li:hover{

background-color: #f5f5f5;

}



</style>




</head>




<body>


<div class="header">


<div class="header_content">


<div class="header_left">


<a href="" class="header_a">中國(guó)大陸&nbsp;<i class="fa fa-angle-down"></i></a>


<a href="" style="color: #f22e00">親,請(qǐng)登錄</a>


<a href="">免費(fèi)注冊(cè)</a>


<a href="">手機(jī)逛淘寶</a>


</div>


<div class="header_right">


<a href="" class="header_a">我的淘寶&nbsp;<i class="fa fa-angle-down"></i>

<ul>

<li>已買到的寶貝</li>

<li>足跡</li>

</ul>

</a>


<a href="" class="header_a"><i class="fa fa-shopping-cart"></i>&nbsp;購(gòu)物車&nbsp;<i class="fa fa-angle-down"></i></a>


<a href=""><i class="fa fa-star"></i>&nbsp;收藏夾</a>


<a href="">商品分類</a>


<a href="" class="header_a">賣家中心&nbsp;<i class="fa fa-angle-down"></i>

<ul>

<li>免費(fèi)開店</li>

<li>已賣出的寶貝</li>

<li>已買到的寶貝</li>

</ul>

</a>


<a href="" class="header_a">聯(lián)系客服&nbsp;<i class="fa fa-angle-down"></i>

<ul>

<li>消費(fèi)者客服</li>

<li>賣家客服</li>

</ul>

</a>


<a href="">網(wǎng)站導(dǎo)航</a>




</div>


</div>


<div class="clear"></div>


</div>




</body>




</html>

總結(jié):實(shí)現(xiàn)下拉的原理即改變下拉部分的display屬性,另在下拉ul的父級(jí)元素設(shè)置一個(gè)相對(duì)定位,在給ul一個(gè)絕對(duì)定位可以讓ul排版正確而不會(huì)擠掉后面的元素


Korrigierender Lehrer:韋小寶Korrekturzeit:2019-01-31 09:15:07
Zusammenfassung des Lehrers:寫的很不錯(cuò) css實(shí)現(xiàn)下拉效果還是比較簡(jiǎn)單的 課后記得要多練習(xí)哦 繼續(xù)加油吧

Versionshinweise

Beliebte Eintr?ge