CSS實(shí)現(xiàn)讓文字半透明顯示在圖片上的方法
發(fā)布時(shí)間:2015-05-09 16:38:17 作者:佚名
我要評(píng)論

這篇文章主要為大家介紹了CSS實(shí)現(xiàn)讓文字半透明顯示在圖片上的方法,實(shí)例分析了css使用filter:alpha控制半透明效果的技巧,需要的朋友可以參考下
本文實(shí)例講述了CSS實(shí)現(xiàn)讓文字半透明顯示在圖片上的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
復(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=utf-8" />
<title>文字顯示在圖片上</title>
<style type="text/css">
*{
border:none;text-decoration:none
}
.wrap{
margin:8px;position:relative
}
.photo a{
position:absolute;display:block;
border:1px solid #555555;
}
.photo a:hover{
border:1px solid #FFFFFF;
}
.photo span{
width:500px;background:#000;display:block;
position:absolute;bottom:0;left:0;color:#fff;
filter:alpha(opacity=50);-moz-opacity:0.6;
opacity:0.6;font:bold 12px/30px Verdana, Arial;
text-align:center;cursor:hand;
}
.photo a:hover span{
text-decoration:underline
}
</style>
</head>
<body>
<div class="wrap">
<div class="photo">
<a href="#">
<img src="wall8.jpg" border="0" alt=""/>
<span>標(biāo)題層疊在圖片上,標(biāo)題文字和背景半透明。鼠標(biāo)經(jīng)過(guò)邊框換色。
</span>
</a></div>
</div>
<div>腳本之家:http://chabaoo.cn/</div>
</body>
"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=utf-8" />
<title>文字顯示在圖片上</title>
<style type="text/css">
*{
border:none;text-decoration:none
}
.wrap{
margin:8px;position:relative
}
.photo a{
position:absolute;display:block;
border:1px solid #555555;
}
.photo a:hover{
border:1px solid #FFFFFF;
}
.photo span{
width:500px;background:#000;display:block;
position:absolute;bottom:0;left:0;color:#fff;
filter:alpha(opacity=50);-moz-opacity:0.6;
opacity:0.6;font:bold 12px/30px Verdana, Arial;
text-align:center;cursor:hand;
}
.photo a:hover span{
text-decoration:underline
}
</style>
</head>
<body>
<div class="wrap">
<div class="photo">
<a href="#">
<img src="wall8.jpg" border="0" alt=""/>
<span>標(biāo)題層疊在圖片上,標(biāo)題文字和背景半透明。鼠標(biāo)經(jīng)過(guò)邊框換色。
</span>
</a></div>
</div>
<div>腳本之家:http://chabaoo.cn/</div>
</body>
希望本文所述對(duì)大家的web網(wǎng)頁(yè)設(shè)計(jì)有所幫助。
相關(guān)文章
純css實(shí)現(xiàn)背景圖片半透明內(nèi)容不透明的方法
這篇文章主要介紹了純css實(shí)現(xiàn)背景圖片半透明內(nèi)容不透明的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-03-12- 這篇文章主要給大家介紹了利用CSS3制作簡(jiǎn)單的3d半透明立方體圖片展示的相關(guān)資料,文中給出了完整的示例代碼,對(duì)大家的理解和學(xué)習(xí)具有一定的參考價(jià)值,需要的朋友們下面來(lái)一2017-03-25
- 眾所周知,透明格式的PNG24在IE6透明部分將會(huì)被灰色替代.解決方法:用PNG8格式圖片替代PNG24格式的圖片,使用CSS濾鏡,插件等等2012-12-07
css3實(shí)現(xiàn)背景圖片半透明內(nèi)容不透明的方法示例
這篇文章主要介紹了css3實(shí)現(xiàn)背景圖片半透明內(nèi)容不透明的方法示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小2021-04-13