z-index+filter
只要字的z-index > 图片的z-index就行!透明度可以慢慢调
只要字的z-index > 图片的z-index就行!透明度可以慢慢调
解决方案 »
- JS怎么做到让表单提交时不跳转!还有怎么设置跳转不可用呢?
- 函数添加判断特殊字符
- Jquery中load()中载入静态页面时出现乱码
- firefox 如何捕获关闭事件
- javascript 里面的layer到底是什么东西?
- 请教一个 截取字符串的问题 思路想用正则表达式
- XPSPII系统IE始终报错
- ★★★用window.open弹出的窗口里怎么用innerHTML写东西啊??★★★
- 关于netscape的一些html语法和一些和netscape相关的对象比如frame之类的应该到哪里去查参考?
- html文件里能不能引用*.js文件一样引用*.htm
- 看不太懂这个JS,谢谢了
- 如何输出数字为01234这样0开头的数字?
<!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>无标题文档</title>
<style type="text/css">
.container{
position:relative;
}
.text{
position:absolute; z-index:100; left:10px; top:10px; color:#00FF00;
}
</style>
</head><body>
<div class="container">
<img src="http://avatar.profile.csdn.net/B/5/5/2_xing527640118.jpg" border="0" />
<div class="text">测试文字</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
#div1{
position:relative;
}
#div2{
position:relative;
left:10px;
top:-20px;
color:#63C;
}
</style>
</head><body>
<div id="div1">
<img src="1.gif" border="0" />
<div id="div2">插入文字</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head><body>
<img style="z-index:1" src="http://avatar.profile.csdn.net/B/5/5/2_xing527640118.jpg" border="0" />
<table style="position:absolute;z-index:2;left:5px;top:15px"><tr><td>文字</td></tr></table>
</body>
</html>
<!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>无标题文档</title>
<style type="text/css">
.container{
position:relative;
}
.text{
position:absolute; z-index:100; left:10px; top:10px; color:#00FF00;
}
</style>
</head><body>
<table class="container" border="1">
<tr><td>
<img src="http://avatar.profile.csdn.net/B/5/5/2_xing527640118.jpg" border="0" />
<table class="text" border="0" cellpadding="0" cellspacing="0">
<tr><td>测试文字</td>
</table>
</td></tr>
</table>
</body>
</html>
并且容器的位置为 position:absolute;
z-index 大于图片的值,
当然容器必须是无背景或者是透明的.
然后设置容器坐标就可以了.
<!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>无标题文档</title>
<style type="text/css">
div{color:#FF0000;}
img{
position:absolute; z-index:-1;
}
</style>
</head><body>
<div>
<img src="http://avatar.profile.csdn.net/B/5/5/2_xing527640118.jpg" border="0" />
测试文字
</div>
</body>
</html>
直接搞定
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
div{color:#FF0000;position:relative;
}
img{
position:absolute; z-index:-1;
}
</style>
</head><body>
<div>
<img src="http://avatar.profile.csdn.net/B/5/5/2_xing527640118.jpg" border="0" />
测试文字
</div>
</body>
</html>