武林网(www.vevb.com)文章简介:css3制作网页实例:点击切换不同的CSS列表.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">}
.view_control_1:checked ~ #item_list li p {
opacity:1;
visibility:visible;/*属性可使元素可见*/
transition:.4s ease-out;
}
.view_control_1:checked ~ #item_list li {
width:300px;
transition: .4s ease-out;
}
/*list2*/
.view_control_2:checked ~ #item_list li img {
opacity:0;
width:0;
visibility:visible;
transition:.4s ease-out;
}
.view_control_2:checked ~ #item_list li p {
opacity:1;
visibility:visible;
transition:.4s ease-out;
}
.view-control_2:checked ~ #item_list li {
width:900px;
transition:.4s .4s ease-out;
}
/*list3*/
.view_control_3:checked ~ #item_list li img {
opacity:1;
width:100px;
visibility:visible;
transition:.4s ease-out;
}
.view_control_3:checked ~ #item_list li p {
opacity:1;
visibility:visible;
transition:.4s ease-out;
}
.view_control_3:checked ~ #item_list li {
width:900px;
transition:.4s ease-out;
}
/*list4*/
.view_control_4:checked ~ #item_list li img {
opacity:1;
width:100px;
visibility:visible;
transition:.4s ease-out;
}
.view_control_4:checked ~ #item_list li p {
opacity:0;
position:absolute;
visibility:hidden;
transition:.4s ease-out;
}
.view_control_4:checked ~ #item_list li {
width:100px;
transiton:.4s ease-out;
}
</style>
</head>
<body>
<div class="content">
<input name="view_control" type="radio" class="view_control_1" checked="checked"/>
<span class="control first"><img src="images/blockinline.png" /></span>
<input name="view_control" type="radio" class="view_control_2"/>
<span class="control"><img src="images/plainlist.png" /></span>
<input name="view_control" type="radio" class="view_control_3" />
<span class="control"><img src="images/blocklist.png" /></span>
<input name="view_control" type="radio" class="view_control_4" />
<span class="control last"><img src="images/block.png" /></span>
<ul id="item_list">
<li> <img src="images/angrybird.png" />
<p> <span class="title">疯狂的小喵</span> <span class="txt">疯狂的小喵</span> </p>
</li>
<li><img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
<li> <img src="images/cuttherope.png" />
<p><span class="title">Draw Something</span><span class="txt">疯狂的小喵</span></p>
</li>
</ul>
</div>
</body>
</html>
新闻热点
疑难解答