非重复背景图片(使用HTML5,而不是CSS)? [英] Non repetition background image (using HTML5, not CSS)?
问题描述
我希望背景图片能覆盖整个网页,但它会不断重复.有没有办法通过HTML将其设置为非重复?
I want my background image to cover my whole web page but it keeps on repeating. Is there a way to set it to non-repetition via HTML?
推荐答案
您不能.
首先, background
是一个过时的属性.浏览器仍然支持它.
First of all, background
is an obsolete attribute. Browsers still support it.
第二,它不是HTML5的一部分,如您在全局属性).同时您也没有使用HTML5,请停止假装自己.
Second, it is not part of HTML5, as you can see in the list of attributes of the body element (see also global attributes). Which also you are not using HTML5, stop pretending you are.
最后,从来没有一个属性可以控制背景的重复方式.至少没有记录.
And finally, there never was an attribute to control how the background repeats. At least not documented.
为什么要这个?甚至-不太好-旧的IE6也支持CSS background-repeat
和 background-size
.好吧,除了PNG存在问题.有骇客.请参见在IE6中背景重复功能似乎无效,并且 IE6 PNG透明CSS背景重复修复.
Why do you want this? Even - not so good - old IE6 supports CSS background-repeat
and background-size
. Well, except it has problems with PNGs. There are hacks. See Background repeat doesn't seem to work in IE6 and IE6 PNG Transparency CSS background-repeat Fix.
我试图看看人们在过去的千年中是如何做的.您知道,在Windows 95周围.找不到任何东西.也许比我认识的大一些,当我们拥有Windows 98和IE6时,我就开始学习HTML.但是,我敢打赌,答案是您做不到.
I tried to look how people did this past millelium. You know, around Windows 95. Could not find anything. Perhaps somebody older than me knows, I began learning HTML when we had Windows 98 and IE6. However, I bet the answer is you could not do it.
为什么不使用CSS(和HTML5)进行更改?
Why don't you use CSS (and HTML5 by the way) for a change?
这篇关于非重复背景图片(使用HTML5,而不是CSS)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!