最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

使用CSS制作立體導(dǎo)航欄

  發(fā)布時(shí)間:2017-10-16 10:38:28   作者:佚名   我要評論
這篇文章主要介紹了使用CSS制作立體導(dǎo)航欄的相關(guān)資料,需要的朋友可以參考下

css制作的立體導(dǎo)航欄,具體實(shí)現(xiàn)代碼如下所示:

<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>CSS制作立體導(dǎo)航</title>
        <link rel="stylesheet" href="http://www.w3cplus.com/demo/css3/base.css">
        <style>
            body{
              background: #ebebeb;
            }
            .nav{
              width:560px;
              height: 50px;
              font:bold 0/50px Arial;
              text-align:center;
              margin:40px auto 0;
              background: #f65f57;
             /*制作導(dǎo)航圓角*/
              border-radius: 8px;
             /*制作導(dǎo)航立體效果*/
              box-shadow: 0 7px 0 #ba4a45;
            }
            .nav a{
              display: inline-block;
              /* a元素的過渡屬性:1、設(shè)置所有a標(biāo)簽過渡;2、過渡時(shí)間;3、速度曲線:以慢速開始的過渡效果 */
                -webkit-transition: all 0.2s ease-in;/* Safari 和 Chrome */
                -moz-transition: all 0.2s ease-in;/* Firefox */
               -o-transition: all 0.2s ease-in;/* Opera */
               -ms-transition: all 0.2s ease-in;/* IE 9 */
               transition: all 0.2s ease-in;
            }
            .nav a:hover{
                /* 鼠標(biāo)移上時(shí)的效果;定義2D旋轉(zhuǎn)10度 */
              -webkit-transform:rotate(10deg);
              -moz-transform:rotate(10deg);
              -o-transform:rotate(10deg);
              -ms-transform:rotate(10deg);
              transform:rotate(10deg);
            }
            .nav li{
              position:relative;
              display:inline-block;
              padding:0 16px;
              font-size: 14px;
              text-shadow:1px 2px 4px rgba(0,0,0,.5);
              list-style: none outside none;
            }
            /*制作導(dǎo)航分隔線效果*/
            .nav li::before,
            .nav li::after{
              content:"";
              position:absolute;
              top:14px;
              height: 25px;
              width: 1px;
            }
            .nav li::after{
              right: 0;
              /* 線性漸變 */
              background: -moz-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,.2) 50%, rgba(255,255,255,0));
              background: -webkit-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,.2) 50%, rgba(255,255,255,0));
              background: -o-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,.2) 50%, rgba(255,255,255,0));
              background: -ms-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,.2) 50%, rgba(255,255,255,0));
              background: linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,.2) 50%, rgba(255,255,255,0));
            }
            .nav li::before{
              left: 0;
              background: -moz-linear-gradient(top, #ff625a, #9e3e3a 50%, #ff625a);
              background: -webkit-linear-gradient(top, #ff625a, #9e3e3a 50%, #ff625a);
              background: -o-linear-gradient(top, #ff625a, #9e3e3a 50%, #ff625a);
              background: -ms-linear-gradient(top, #ff625a, #9e3e3a 50%, #ff625a);
              background: linear-gradient(top, #ff625a, #9e3e3a 50%, #ff625a);
            }
            /*刪除導(dǎo)航第一個(gè)導(dǎo)航項(xiàng)左邊的分隔線*/
            .nav li:first-child::before{
              background: none;
            }
            /*刪除導(dǎo)航最后一個(gè)導(dǎo)航右邊的分隔線*/
            .nav li:last-child::after{
              background: none;
            }
            .nav a,
            .nav a:hover{
              color:#fff;
              text-decoration: none;
            }
        </style>
    </head>
    <body>
        <ul class="nav">
        <li><a href="">首頁</a></li>
        <li><a href="">個(gè)人簡介</a></li>
        <li><a href="">作品集</a></li>
        <li><a href="">博客</a></li>
        <li><a href="">資源</a></li>
        <li><a href="">聯(lián)系我</a></li>
        </ul>
    </body>
</html>

效果圖:

總結(jié):

1、body部分用無序列表

2、(1)hover

    鼠標(biāo)移上時(shí)的效果。

 ?。?)疑問::before和:before的區(qū)別

    簡單來說單冒號(:)用于CSS3偽類,雙冒號(::)用于CSS3偽元素。

    w3c關(guān)于css選擇器的規(guī)范:

A pseudo-element is made of two colons (::) followed by the name of the pseudo-element.
This :: notation is introduced by the current document in order to establish a discrimination between pseudo-classes and pseudo-elements. For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2 (namely, :first-line, :first-letter, :before and :after). This compatibility is not allowed for the new pseudo-elements introduced in CSS level 3.

    簡單翻譯:偽元素由雙冒號和偽元素名稱組成。雙冒號是在當(dāng)前規(guī)范中引入的,用于區(qū)分偽類和偽元素。不過瀏覽器需要同時(shí)支持舊的已經(jīng)存 在的偽元素寫法,比如:first-line、:first-letter、:before、:after等,而新的在CSS3中引入的偽元素則不允許再支持舊的單冒號的寫法。

    那么現(xiàn)在就可以完整的回答標(biāo)題中的問題了,對于CSS2之前已有的偽元素,比如:before,單冒號和雙冒號的寫法::before作用是一樣的。

    所以,如果你的網(wǎng)站只需要兼容webkit、firefox、opera等瀏覽器,建議對于偽元素采用雙冒號的寫法,如果不得不兼容IE瀏覽器,還是用CSS2的單冒號寫法比較安全。

總結(jié)

以上所述是小編給大家介紹的使用CSS制作立體導(dǎo)航欄,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論

白水县| 景德镇市| 西吉县| 武功县| 河间市| 梁山县| 兴海县| 河北区| 三都| 镇江市| 许昌县| 中江县| 治县。| 鄱阳县| 文登市| 通榆县| 林西县| 长治县| 青铜峡市| 壤塘县| 河池市| 鲁山县| 莲花县| 万年县| 陵川县| 南丹县| 通州市| 原平市| 红河县| 八宿县| 襄樊市| 司法| 黄龙县| 湘乡市| 临汾市| 奉节县| 乌拉特前旗| 大连市| 饶平县| 启东市| 韶山市|