html-製作導覽功能表

來源:互聯網
上載者:User

標籤:color   使用   ar   div   sp   代碼   log   html   on   

導覽功能表nav:
1.使用列表標籤<ul>
2.使用浮動布局float
3.使用超連結標籤<a>:要使用<a>標籤的margin外邊距,需要讓<a>標籤成為一個區塊層級元素,添加display:block屬性

標籤代碼

<div class="header">
           
                <div class="logo">
                logo
                </div>

                <div class="nav">
                    <ul>
                        <li><a href="#">one</a></li>
                        <li><a href="#">two</a></li>
                        <li><a href="#">three</a></li>
                        <li><a href="#">foue</a></li>
                        <li><a href="#">siuew</a></li>
                        <li><a href="#">fiev</a></li>
                    </ul>
                </div>

        </div>

樣式代碼

nav{
    float:right;
    height: 100px;
    width: 80%;
    margin: auto;
}
.nav ul{
    padding: 0px;
}
.nav ul li{
    float: right;
}
.nav ul li a{
    display: block;
    padding:20px;
    background-color: red;
    margin-right: 10px;
    margin-top: 10px;
}
.nav ul li a:hover{
    background-color: rgba(100,100,100,0.2);
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
    border-radius: 5px;
}

html-製作導覽功能表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.