當前位置:編程學習大全網 - 遊戲軟體 - html怎麽用<ul>和<li>制作導航條?求簡便壹點的代碼

html怎麽用<ul>和<li>制作導航條?求簡便壹點的代碼

HTML:

<!DOCTYPE html>

<html>

<head>

<meta charset='utf-8'>

<style type="text/css">

html, body{

margin: 0;

padding: 0;

background: #E6E6E6;

}

.nav{

list-style: none;

width: 100%;

height: 30px;

background: #171714;

}

.nav li{

float: left;

width: 80px;

height: 30px;

background: #373734;

border-left: solid 1px #10100D;

border-right: solid 1px #535351;

text-align: center;

font: 14px arial,'Microsoft Yahei',宋體,sans-serif,tahoma;

font-weight: bold;

line-height: 30px;

color: #898988;

cursor: pointer;

}

.nav li:hover{

background: #4D4D4B;

color: #fff;

}

</style>

</head>

<body>

<ul class="nav">

<li>Menu</li>

<li>Menu</li>

<li>Menu</li>

<li>Menu</li>

<li>Menu</li>

</ul>

</body>

</html>

也可以參考這個,帶了二級、三級下拉列表:

  • 上一篇:誰能介紹壹下Source Insight?謝謝!
  • 下一篇:QQ空間個性簽名怎麽添加
  • copyright 2024編程學習大全網