最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CSS相冊(cè)簡(jiǎn)單實(shí)現(xiàn)方法(功能分析及代碼)

  發(fā)布時(shí)間:2013-04-22 10:14:11   作者:佚名   我要評(píng)論
相冊(cè)在默認(rèn)情況下以縮略圖的形式顯示,并且不壓縮相片的原有寬度和高度屬性,而是取相冊(cè)的某個(gè)部分作為縮略圖形式,感興趣的朋友可以參考下哈
很久以前就知道ctrly.cn 了感覺(jué)很簡(jiǎn)單也沒(méi)太在意,
效果可以看這里:
http://www.ctrly.cn/
下面是提取出來(lái)的代碼 :

復(fù)制代碼
代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312" />
<title>HTML—CSS 簡(jiǎn)易相冊(cè)</title>
<style type="text/css" media="screen">
/* CSS Reset */
* {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
body {
font-family: Arial, "MS Trebuchet", sans-serif;
color:#888;
}
a{
text-decoration:none;
color:#8ac;
}
/* Setup Tabs */
ul{
background:#000;
width:125px; /* Width of Tab Image */
float: left;
list-style: none;
border-right:8px solid black;
}
ul li{
height:75px; /* Height of Tab Image */
}
/* Setup Tab so normal opacity is 40 and rollover is 100 */
ul li a img{
/* for IE */
-ms-filter:"PRogid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
filter:alpha(opacity=40);
/* CSS3 standard */
opacity:0.4;
}
ul li a:hover img{
/* for IE */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter:alpha(opacity=100);
/* CSS3 standard */
opacity:1.0;
}
#images{
width:500px;
height:300px;
overflow:hidden;
float:left;
}
#wrapper{
width:633px;
height:300px;
border:8px solid black;
margin:0px auto;
}
#credits{
width:633px;
margin: 0 auto;
text-align: right;
}
p{
margin-top:10px;
font-size:9pt;
}
h1#header{
width:633px;
margin:15px auto 5px;
font-size:14pt;color:#f00;
}
.foot{
width:633px;background:#111;font-size:12px;
margin:2px auto;border-top:1px solid #000;
}
</style>
</head>
<body>
<h1 id="header">單擊左邊的小圖看效果</h1>
<div id="wrapper">
<ul>
<li><a href="#image1" id="tab1"><img src="http://www.ctrly.cn/img/tab1.jpg" alt="" title="" /></a></li>
<li><a href="#image2" id="tab2"><img src="http://www.ctrly.cn/img/tab2.jpg" alt="" title="" /></a></li>
<li><a href="#image3" id="tab3"><img src="http://www.ctrly.cn/img/tab3.jpg" alt="" title="" /></a></li>
<li><a href="#image4" id="tab4"><img src="http://www.ctrly.cn/img/tab4.jpg" alt="" title="" /></a></li>
</ul>
<div id="images">
<div><a name="image1"></a><img src="http://www.ctrly.cn/img/image1.jpg" alt="" title="" /></div>
<div><a name="image2"></a><img src="http://www.ctrly.cn/img/image2.jpg" alt="" title="" /></div>
<div><a name="image3"></a><img src="http://www.ctrly.cn/img/image3.jpg" alt="" title="" /></div>
<div><a name="image4"></a><img src="http://www.ctrly.cn/img/image4.jpg" alt="" title="" /></div>
</div>
</div>
</body>
</html>

功能分析
相冊(cè)在默認(rèn)情況下以縮略圖的形式顯示,并且不壓縮相片的原有寬度和高度屬性,而是取相冊(cè)的某個(gè)部分作為縮略圖形式。
當(dāng)鼠標(biāo)懸停于某張縮略圖上時(shí),相冊(cè)列表中的縮略圖恢復(fù)為原始相片的寬度和高度,展現(xiàn)在相冊(cè)的某個(gè)固定的區(qū)域,同時(shí)縮略圖為空。

關(guān)鍵css代碼

復(fù)制代碼
代碼如下:

li a{
display:block;
width:70px;
height:70px;
overflow:hidden; /*important*/
float:left;
margin:0.5px;
border:2px solid #efdeb0;
}
li a:hover img{
position:absolute; /*定位 */
width:550px;
height:550px;
top:10px;
left:10px;
margin:0;
border:4px soild #a98175;
}

相關(guān)文章

最新評(píng)論

珲春市| 灌云县| 高雄市| 沁水县| 万州区| 临澧县| 河北省| 象州县| 榕江县| 洛宁县| 迭部县| 博兴县| 海原县| 临西县| 顺义区| 昆山市| 万年县| 开江县| 余庆县| 阜康市| 河曲县| 宁武县| 贡嘎县| 湖南省| 西丰县| 光泽县| 耿马| 黄大仙区| 永善县| 扶风县| 大庆市| 中方县| 久治县| 云龙县| 崇仁县| 宜章县| 夹江县| 柘城县| 宜君县| 平和县| 石渠县|