用html添加背景图片时.怎么让它不重复.并且居中.

如题所述

在你所加背景图片的table或div里加入如下代码:style="background-position:center; background-repeat:no-repeat;"

例如:<table width="200" height="200" style="background-position:center; background-repeat:no-repeat;" background="a.jpg">

补充:                                                                                       

style="background-position:center; background-repeat:no-repeat;"

加在<body>里面就可以了。

例如:

<body style="background-position:center; background-repeat:no-repeat;">

html简介:

超文本标记语言,标准通用标记语言下的一个应用。 “超文本”就是指页面内可以包含图片、链接,甚至音乐、程序等非文字元素。

超文本标记语言的结构包括“头”部分(英语:Head)、和“主体”部分(英语:Body),其中“头”部提供关于网页的信息,“主体”部分提供网页的具体内容。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-12-16
在你所加背景图片的table或div里加入如下代码:style="background-position:center; background-repeat:no-repeat;"例如:<table width="200" height="200" style="background-position:center; background-repeat:no-repeat;" background="a.jpg">本回答被网友采纳
相似回答