html - 身体backgorund图像重复

Ron*_*nny 2 html

正如您在本页中看到的那样 - http://www.white-cell.com/events.htm - 在底部,背景图像因长文本而重复.与此相关的行是:

<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" background="images/bg_wide.gif">
Run Code Online (Sandbox Code Playgroud)

谢谢!

Pek*_*ica 10

使用CSS指定背景图像(background非常不赞成)并关闭重复.

把它放在你的head部分:

<style type="text/css">
body
 {
     background-image: url(images/bg_wide.gif);
     background-repeat: no-repeat;
 }
 </style>
Run Code Online (Sandbox Code Playgroud)

还有一个属性来定位背景图像(background-position).

更多关于在w3schools定义背景