实用:滑动门tag切换
css:
1 *{ margin:0; padding:0; list-style:none; font-size:12px;}
2 a{ text-decoration:none; color:#333;}
3 #wrap{ position:relative; width:330px; height:220px; margin:20px auto;}
4 #wrap .title{ position:relative; width:100%; overflow:hidden;}
5 .title li{ display:block; float:left; padding:0 0 0 5px; margin:0 5px 0 0; background:url(img/tag_left.gif) left 0 no-repeat;}
6 .title li a{ display:block; padding:6px 15px 3px 10px; background:url(img/tag_right.gif) right 0 no-repeat; text-align:center; }
7 .title li.now{ background-position:0 -23px;}
8 .title li.now a{ background-position:right -23px; font-weight:700;}
9 .cont{ margin:-1px 0 0; width:308px; padding:10px; border:1px solid #d0d0d0; overflow:hidden; z-index:-100;}
10 .cont li{ margin:0 0 5px 0;}
2 a{ text-decoration:none; color:#333;}
3 #wrap{ position:relative; width:330px; height:220px; margin:20px auto;}
4 #wrap .title{ position:relative; width:100%; overflow:hidden;}
5 .title li{ display:block; float:left; padding:0 0 0 5px; margin:0 5px 0 0; background:url(img/tag_left.gif) left 0 no-repeat;}
6 .title li a{ display:block; padding:6px 15px 3px 10px; background:url(img/tag_right.gif) right 0 no-repeat; text-align:center; }
7 .title li.now{ background-position:0 -23px;}
8 .title li.now a{ background-position:right -23px; font-weight:700;}
9 .cont{ margin:-1px 0 0; width:308px; padding:10px; border:1px solid #d0d0d0; overflow:hidden; z-index:-100;}
10 .cont li{ margin:0 0 5px 0;}
xhtml:
Code
js:
Code
好了就这么多了,不想解释了,自己看吧,很简单~~哈哈