css实战 苹果导航

Original 2019-01-12 22:11:27 206
abstract:<!DOCTYPE html><html lang="zh-cn"><head>   <meta charset="UTF-8">   <title>css实战 苹果导航</title>   <meta name=&quo

<!DOCTYPE html>

<html lang="zh-cn">

<head>

   <meta charset="UTF-8">

   <title>css实战 苹果导航</title>

   <meta name="viewport" content="width=device-width, initial-scale=1.0">

   <meta http-equiv="X-UA-Compatible" content="ie=edge">

   <link rel="shortcut icon" type="image/x-icon" href="image/icon.png">

   <link rel="stylesheet" type="text/css" href="css/demo.css">

   

</head>

<body>

   <div id="header">

       <div class="nav">

           <ul>

               <li><a href="#" class="icon apple-icon"><span></span></a></li>

               <li><a href="#"><span>Mac</span></a></li>

               <li><a href="#"><span>iPad</span></a></li>

               <li><a href="#"><span>iPhone</span></a></li>

               <li><a href="#"><span>Watch</span></a></li>

               <li><a href="#"><span>Music</span></a></li>

               <li><a href="#"><span>技术支持</span></a></li>

               <li><a href="#" class="icon search-icon"><span></span></a></li>

               <li style="margin-right:0;"><a href="#" class="icon stroe-icon"><span></span></a></li>

           </ul>

           <div class="clear"></div>

       </div>

   </div>

</body>

</html>

/* css 外部样式 */


*{

   margin: 0;

   padding: 0;

}

.clear{

   clear: both;

}

#header{

   background-color: rgb(49, 49, 49);

}

.nav{

   width: 1000px;

   margin: 0 auto;

}


.nav li{

   list-style: none;

   float: left;

   margin-right: 59px;

}

.icon{

   width: 16px;

   background-position: center center;

   background-repeat: no-repeat;

}

.apple-icon{

   background-image: url('../images/apple.png');

}

.search-icon{

   background-image: url('../images/search.png');

}

.stroe-icon{

   background-image: url('../images/store.png');

}


.nav li a{

   text-decoration: none;

   color: rgb(166, 166, 166);

   display: block;    

   height: 44px;

   padding: 0 10px;

   line-height: 44px;

   text-align: center;

   font-size: 14px;

}

.nav li a:hover{

   color: #fff;

}



Correcting teacher:天蓬老师Correction time:2019-01-13 09:52:08
Teacher's summary:你的背景相关样式,用得非常准确, 不错的, css3还有很多有关背景的,可以了解一下

Release Notes

Popular Entries