背景可以设成拉伸吗?
时间:2004-06-01
来源:互联网
看了一下CSS,只提到平铺的重复,不重复
可不可以在一个表格中把一张图片拉伸作为背景?请赐教!谢谢!
可不可以在一个表格中把一张图片拉伸作为背景?请赐教!谢谢!
作者: timwhoung 发布时间: 2004-06-01
前面发过了。
=================================================
<body>
<table>
<tr>
<td bgcolor=#cccccc id="s" style='border:1px solid #000000;position:relative;left:100px;top:100px;FONT:bold 12px Tahoma'> <font>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR><font>
</td>
</tr>
</table>
<table>
<tr>
<td bgcolor=#cccccc id="s" style='border:1px solid #000000;position:relative;left:100px;top:100px;FONT:bold 12px Tahoma'> <font>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLETABLETABLETABLETABLETABLE<BR><font>
</td>
</tr>
</table>
<script>
var n=document.all.s.length;
for(i=0;i<n;i++)
{
var TdHeight=document.all.s.offsetHeight-2;
var TdWidth=document.all.s.offsetWidth-2;
var interHTML="<img src=http://www.phpx.com/happy/avatar.php?userid=17889&dateline=1074682894 style='position:absolute;top:0px;left:0px;width:"
+TdWidth
+"px;height:"
+TdHeight
+"px;z-index:-1' id='oImg'>";
document.all.s.innerHTML+=interHTML;
}
</script>
<body>
=====================================
=================================================
<body>
<table>
<tr>
<td bgcolor=#cccccc id="s" style='border:1px solid #000000;position:relative;left:100px;top:100px;FONT:bold 12px Tahoma'> <font>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR><font>
</td>
</tr>
</table>
<table>
<tr>
<td bgcolor=#cccccc id="s" style='border:1px solid #000000;position:relative;left:100px;top:100px;FONT:bold 12px Tahoma'> <font>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLE<BR>TABLETABLETABLETABLETABLETABLETABLETABLETABLETABLE<BR><font>
</td>
</tr>
</table>
<script>
var n=document.all.s.length;
for(i=0;i<n;i++)
{
var TdHeight=document.all.s.offsetHeight-2;
var TdWidth=document.all.s.offsetWidth-2;
var interHTML="<img src=http://www.phpx.com/happy/avatar.php?userid=17889&dateline=1074682894 style='position:absolute;top:0px;left:0px;width:"
+TdWidth
+"px;height:"
+TdHeight
+"px;z-index:-1' id='oImg'>";
document.all.s.innerHTML+=interHTML;
}
</script>
<body>
=====================================
作者: longhorn 发布时间: 2004-06-01
试了一下,你贴的代码可以,但不知道如何使用,是使用绝对定位的吗?
作者: timwhoung 发布时间: 2004-06-01
是绝对定位。
把需要背景的<td>的 id设定成 "s"(你可以换,但后面的代码也得换,我是随便写的)
注意td 的 positon是relative
把<script>里面的代码
放到function window.onload(){ ,..... } 函数之间。
把需要背景的<td>的 id设定成 "s"(你可以换,但后面的代码也得换,我是随便写的)
注意td 的 positon是relative
把<script>里面的代码
放到function window.onload(){ ,..... } 函数之间。
作者: longhorn 发布时间: 2004-06-02
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28