网页的背景图片的 html 代码怎么写

我有一张很小的图片( 宽: 100 px 高: 100 px ),比如我把图片上传到 www.abcdef.com/background.jpg

我要怎么些html代码,因为图片很小,所以我需要图片横竖都要重复。

谢谢。

比如直接写在你要用的地方:
<td background="www.abcdef.com/background.jpg">当然地址最好是相对路径.

也可写在样式里面:
<style="background-image:url(www.abcdef.com/background.jpg)>

背景重复样式:
background-repeat:repeat横竖都重复
background-repeat:none不重复
background-repeat:repeat-x横向重复
background-repeat:repeat-y竖向重复
什么都不写,默认是都重复,所以你不写他会自动平铺背景.
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-10-11
1、CSS外部样式:
body{background:url(1.jpg) repeat-x;} 前景图片 平铺

2、html内部样式:
<style type="text/css">
body{background:url(1.jpg) repeat-x;} 前景图片 平铺
</style>

3、html行内样式:
<div style="background:url(www.abc/background.jpg)"></div>
如果能帮到你,请采纳
第2个回答  2009-12-28
用CSS代码
<div style="width:100px;height:100px;background:url(www.abcdef.com/background.jpg)">
</div>本回答被网友采纳
第3个回答  2020-03-27
<style
type="text/css">
<!--
body
{
background-image:
url(bg.gif);
background-repeat:
no-repeat;
}
-->
</style>
第4个回答  2009-12-28
推荐使用Dreamweaver网页制作工具,图形界面,所见即所得,非常方便!
相似回答