用CSS实现的图片透明度链接效果代码

代码简介:

一款使用CSS的Alpha透明度实现的图片链接效果,鼠标放上后图片会变为半透明,然后出现文字介绍,+可以加入其它功能,一般是加入收藏,根据你的需要了,可以自己改。

代码内容:

View Code
<!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>用CSS实现的图片透明度链接效果代码 - www.webdm.cn</title>
<style type="text/css">
<!--
*
{
margin
:0px;
padding
:0px;
}
body
{
margin
:20px;
font-size
: 12px;
line-height
:18px;
}
.blueidea
{
background-color
: #CCC;
margin
:5px;
padding
: 3px;
height
: 96px;
width
: 128px;
position
: relative;
float
:left;
}
.blueidea a img
{
height
: 96px;
width
: 128px;
border
:none;
}
.blueidea a span
{
margin-top
:-9000px;
margin-left
:-9000px;
position
: absolute;
}
.blueidea a:hover
{
background-color
: #FFF;
}
.blueidea a:hover span
{
height
: 88px;
width
: 128px;
position
: absolute;
left
: 0px;
top
: 0px;
border
:1px solid #F90;
padding
: 10px 2px 2px 2px;
background
:#FFF;
filter
:alpha(opacity=75);
opacity
:0.9;
display
: block;
text-decoration
: none;
cursor
:pointer;
margin
:0px;
}
.blueidea em
{
position
:absolute;
left
:5px;
bottom
:5px;
width
:25px;
height
:25px;
cursor
:pointer;
background
:url(http://www.webdm.cn/images/20091005/+1.gif) no-repeat;
}
.blueidea em:hover
{
background-image
:url(http://www.webdm.cn/images/20091005/+2.gif) ;}
-->
</style>
</head>

<body>
<div class="blueidea"><a href="#"><img src="http://www.webdm.cn/images/wall1_s.jpg" alt="" /><span>网页代码站,你今

天来了吗?</span></a><em title="我要收藏"></em></div>

<div class="blueidea"><a href="#"><img src="http://www.webdm.cn/images/wall2_s.jpg" alt="" /><span>收集精品的网页特

</span></a><em title="我要收藏"></em></div>

<div class="blueidea"><a href="#"><img src="http://www.webdm.cn/images/wall3_s.jpg" alt="" /><span>WebDm.cn做有质量

的代码下载站</span></a><em title="我要收藏"></em></div>

</body>
</html>
<br />
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!</p>

代码来自:http://www.webdm.cn/webcode/7fb4a96a-e101-4aab-85af-b78fee25d364.html

原文地址:https://www.cnblogs.com/webdm/p/2293104.html