慕课网的一个小课程,练习了一遍,不足之处,欢迎指正(照片在本地,大家可以着重看代码哈):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>爱淘气购物网-JQuery网页定位导航特效</title>
<style>
/*All tag*/
html, body, div, ul, li, img, h1, h2 { margin: 0; padding: 0; }
ul { list-style: none; }
a { text-decoration: none; color: #333; }
/*menu*/
#menu { position: fixed; top: 100px; left: 50%; margin-left: 400px; }
#menu > li > a { display: block; padding: 10px 15px; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; margin: 5px 0; }
#menu > li > a:hover,
#menu > li > a.current { color: #fff; background-color: #0088bb; }
/*content*/
#content { width: 800px; margin: 30px auto; }
h1 { color: #0088bb; font-size: 30px; margin-bottom: 10px; }
.item { border: 1px dotted #0088bb; padding: 20px; margin-bottom: 20px; }
.item > h2 { font-size: 16px; padding-bottom: 5px; border-bottom: 2px solid #0088bb; margin-bottom: 10px; }
.item-list > li { display: inline-block; margin-right: 10px; }
.item-list > li > a > img { width: 230px; height: 230px; border: none;
/* IE6 hack*/
* html, * html body { background-image: url(about:blank); background-attachment: fixed; }
* html #menu { /*position: fixed*/ position: absolute; top: expression((e = document.documentElement.scrollTop ? e : document.body.scrollTop) + 100 + 'px'); }
</style>
</head>
<body>
<ul id="menu">
<li><a class="current" href="#item1" rel="external nofollow" >1F 男装</a></li>
<li><a href="#item2" rel="external nofollow" >2F 女装</a></li>
<li><a href="#item3" rel="external nofollow" >3F 美妆</a></li>
<li><a href="#item4" rel="external nofollow" >4F 数码</a></li>
<li><a href="#item5" rel="external nofollow" >5F 母婴</a></li>
</ul>
<div id="content">
<h1>爱淘气购物网</h1>
<div id="item1" class="item">
<h2>1F 男装</h2>
<ul class="item-list">
<li>
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><img src="1F.jpg" alt="商品图片"></a>










