久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      css如何設(shè)置導(dǎo)航條背景圖片

      在css中,可以利用“background-image”屬性來設(shè)置導(dǎo)航條的背景圖片,該屬性主要用于為元素添加背景圖像,只需要給導(dǎo)航條元素添加“background-image:url(圖片路徑);”樣式即可。

      css如何設(shè)置導(dǎo)航條背景圖片

      本教程操作環(huán)境:windows7系統(tǒng)、CSS3&&HTML5版、Dell G3電腦。

      css如何設(shè)置導(dǎo)航條背景圖片

      在css中,可以利用background-image屬性來設(shè)置導(dǎo)航條背景圖片,background-image 屬性為元素設(shè)置背景圖像。

      元素的背景占據(jù)了元素的全部尺寸,包括內(nèi)邊距和邊框,但不包括外邊距。

      默認(rèn)地,背景圖像位于元素的左上角,并在水平和垂直方向上重復(fù)。

      下面我們通過示例來看一下怎樣利用background-image屬性來設(shè)置背景圖片,示例如下:

      首先我們創(chuàng)建一個導(dǎo)航條

      <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width, initial-scale=1.0">   <meta http-equiv="X-UA-Compatible" content="ie=edge">   <title>Document</title>   <style type="text/css">     *{margin:0;padding: 0;}    ul{        list-style-type: none;        overflow: hidden;                position: fixed;        top: 0;        width: 100%;            }      li {        float: left;    }       li a {        display: block;        color: white;        text-align: center;        padding: 14px 16px;        text-decoration: none;    }       li a:hover{        background-color: red;    }    </style> </head> <body> <ul>    <li><a href="#home">首頁</a></li>    <li><a href="#news">新聞動態(tài)</a></li>    <li><a href="#contact">聯(lián)系我們</a></li>    <li><a href="#about">關(guān)于我們</a></li> </ul>    <div style="background-color:pink;height:1500px;"></div> </body> </html>

      輸出結(jié)果:

      css如何設(shè)置導(dǎo)航條背景圖片

      此時導(dǎo)航條并沒有背景圖片,只需要給導(dǎo)航條元素添加“background-image:url(圖片路徑);”樣式即可,示例如下:

      ul{        list-style-type: none;        overflow: hidden;        background-image:url(1118.02.png);        position: fixed;        top: 0;        width: 100%;    }

      輸出結(jié)果:

      css如何設(shè)置導(dǎo)航條背景圖片

      (學(xué)習(xí)視頻分享:css視頻教程)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號