成熟丰满熟妇高潮XXXXX,人妻无码AV中文系列久久兔费 ,国产精品一国产精品,国精品午夜福利视频不卡麻豆

您好,歡迎來到九壹網(wǎng)。
搜索
您的當(dāng)前位置:首頁用CSS制作立體導(dǎo)航欄的方法

用CSS制作立體導(dǎo)航欄的方法

來源:九壹網(wǎng)
<!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、過渡時間;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)移上時的效果;定義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)航第一個導(dǎo)航項左邊的分隔線*/
 .nav li:first-child::before{
 background: none;
 }
 /*刪除導(dǎo)航最后一個導(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="">個人簡介</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>

效果圖:

1

2

總結(jié):

1、body部分用無序列表

2、(1)hover

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

  (2)疑問::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ū)分偽類和偽元素。不過瀏覽器需要同時支持舊的已經(jīng)存 在的偽元素寫法,比如:first-line、:first-letter、:before、:after等,而新的在CSS3中引入的偽元素則不允許再支持舊的單冒號的寫法。

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

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

Copyright ? 2019- 91gzw.com 版權(quán)所有 湘ICP備2023023988號-2

違法及侵權(quán)請聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市萬商天勤律師事務(wù)所王興未律師提供法律服務(wù)