# 導覽列篇

## 導覽列

標頭中，有很多可以使用的元素像是\<header>\<nav>\<div>等等。\
目前使用div使用方式，而像是其他元素都是可以這樣活用的。

## 浮動&#x20;

![](/files/-MJb9ynrWQg805acPA8r)

{% tabs %}
{% tab title="HTML" %}

```markup
<ul class="navi">
        <li>
            <a href="javascript:;">
                商業平面設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                數位繪畫   
            </a>
        </li>

        <li>
            <a href="javascript:;">
                前端網頁設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                工業產品設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                UI 介面設計   
            </a>
        </li>
    </ul>
```

{% endtab %}

{% tab title="CSS" %}

```css
@charset "utf-8";
body {
    font-family: Arial, Helvetica, "微軟正黑體", sans-serif;
}

.article {
    padding: 10px;
    width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.article p {
    line-height: 1.7;
}

.navi {
    /* background-color: pink; */
    list-style-type: none;
    padding-left: 0;
    height: 50px;
    width: 1100px;
    height: 40px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 10px;
    list-style-type: none;
}

.navi li {
    float: left;
    margin-left: 10px;
    margin-right: 10px;
}

.navi li a {
    color: #fff;
    text-decoration: none;
    display: block;
    width: 200px;
    text-align: center;
    text-align: center;
    line-height: 40px;
    background-color: yellowgreen;
    border-radius: 3px;
}

.navi li a:hover {
    background-color: #8dbb2e;
}
```

{% endtab %}
{% endtabs %}

### 浮動 - 1

![](/files/-MJbAQ8YtFJCsF94Nu_I)

{% tabs %}
{% tab title="HTML" %}

```markup
<ul class="navi">
        <li>
            <a href="javascript:;">
                商業平面設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                數位繪畫   
            </a>
        </li>

        <li>
            <a href="javascript:;">
                前端網頁設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                工業產品設計
            </a>
        </li>

        <li>
            <a href="javascript:;">
                UI 介面設計   
            </a>
        </li>
    </ul>
```

{% endtab %}

{% tab title="CSS" %}

```css
@charset "utf-8";

body {
    font-family: Arial, Helvetica, "微軟正黑體", sans-serif;
}

.article {
    padding: 10px;
    width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.article p {
    line-height: 1.7;
}

.navi{
    width: 1100px;
    list-style-type: none;
    padding-left: 0;
    height: 40px;
    margin-right: auto;
    margin-left: auto;

}

.navi li{
    float: left;
    margin-left: 10px;
    margin-right: 10px;
}

.navi li a {
    display: block;
    width:  200px;
    border-bottom:solid 2px #ccc;
    text-align: center;
    line-height: 40px;
    text-decoration: none;
    color: #000;
    /* background-color: #ccc; */
}

.navi li a:hover{
    background-color: #45f;
    color:#fff;
}
```

{% endtab %}
{% endtabs %}

## 導覽置中

{% tabs %}
{% tab title="CSS" %}

```css

.article {
    padding: 10px;
    width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.article p {
    line-height: 1.7;
}

.navi{
    width: 1100px;
    list-style-type: none;
    padding-left: 0;
    height: 40px;
    margin-right: auto;
    margin-left: auto;

}

.navi li{
    float: left;
    margin-left: 10px;
    margin-right: 10px;
}

.navi li a {
    display: block;
    width:  200px;
    border-bottom:solid 2px #ccc;
    text-align: center;
    line-height: 40px;
    text-decoration: none;
    color: #000;
    /* background-color: #ccc; */
}

.navi li a:hover{
    background-color: #45f;
    color:#fff;
}
```

{% endtab %}

{% tab title="HTML" %}

```markup
    <ul class="navi">
        <li><a class="line_color1" href="javascript:;">商業平面設計</a></li> 
        <li><a class="line_color2" href="javascript:;">數位繪畫</a></li>
        <li><a class="line_color3" href="javascript:;">前端網頁設計</a></li>
        <li><a class="line_color4" href="javascript:;">工業產品設計</a></li>
        <li><a class="line_color5" href="javascript:;">UI 介面設計</a></li>
    </ul>
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="HTML" %}

```markup
 <ul class="navi">
        <li><a class="line_color1" href="javascript:;">商業平面設計</a></li> 
        <li><a class="line_color2" href="javascript:;">數位繪畫</a></li>
        <li><a class="line_color3" href="javascript:;">前端網頁設計</a></li>
        <li><a class="line_color4" href="javascript:;">工業產品設計</a></li>
        <li><a class="line_color5" href="javascript:;">UI 介面設計</a></li>
    </ul>
```

{% endtab %}

{% tab title="CSS" %}

```css
@charset "utf-8";

body {
    background-image: url(../images/bg.jpg);
    /* background-color: #000; */
    font-family: Arial, Helvetica, "微軟正黑體", sans-serif;
}

.navi {
    padding-left: 0;
    text-align: center;
    margin-top: 200px;
    /* margin-left: auto;
    margin-right: auto; */
}

.navi li {
    display: inline;
    /* list-style-type: none; */
}

.navi a {
    padding:15px 20px;
    font-size: 25px;
    display: inline-block;
    /* height: 100px; */
    text-decoration: none;
    color: #fff;
    background-image: url('../images/overlay.png');
}
.navi span{
    display: block;
    font-size: 13px;
    text-transform:uppercase;
    color: red;
}

.navi a:hover{
    color: red;
}
.navi a:hover span{
    color: #fff;
}

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://information9527.gitbook.io/html/qian-duan-san-xiong-di/css-ji-ben-shi-yong/css-pai-ban/biao-tou-pai-ban.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
