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

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

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

復(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 簡易相冊</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>

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

關(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)文章

最新評論

万荣县| 刚察县| 洱源县| 绥中县| 定襄县| 剑阁县| 定州市| 绿春县| 叶城县| 东丰县| 梨树县| 南郑县| 宁河县| 北流市| 油尖旺区| 六安市| 南安市| 西吉县| 彰武县| 潮州市| 泰州市| 清涧县| 民权县| 南安市| 武宣县| 株洲县| 滕州市| 南投县| 弥渡县| 石景山区| 卫辉市| 泗洪县| 泸定县| 南充市| 乳源| 崇阳县| 阜新市| 绥芬河市| 石台县| 兰考县| 拉萨市|