Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
身体中重复图像的CSS是什么_Css - Fatal编程技术网

身体中重复图像的CSS是什么

身体中重复图像的CSS是什么,css,Css,我想实现 我能够在容器中重复图像,但不知道如何在体内以相同的div比例重复 body { } div#container { width: 500px; } div#header { width: 500px; background: url(images/head.jpg) repeat-x; } div#content { height: 500px; width: 500px; } div#footer { width: 500px; background: url(im

我想实现

我能够在容器中重复图像,但不知道如何在体内以相同的div比例重复

body {

}

div#container {
 width: 500px;

}

div#header {
width: 500px;
background: url(images/head.jpg) repeat-x;
}


div#content {
height: 500px;
width: 500px;
}


div#footer {
width: 500px;
background: url(images/footer.jpg) repeat-x;
}

如果我没弄错你的问题,这应该是解决办法。你不应该这样

body {

    }


div#header-container{
  width:100%;
  background: url(images/head.jpg) repeat-x;
}


div#header {
width: 500px;
margin: 0 auto;
}


div#content {
height: 500px;
width: 500px;
margin:0 auto;
}

div#footer-container{
  width:100%;
  background: url(images/footer.jpg) repeat-x;
}

div#footer {
width: 500px;
margin:0 auto;
}
您的html应该如下所示:

<div id="header-container">
  <div id="header"></div>
</div>

<div id="content">
  <div id="header"></div>
</div>

<div id="footer-container">
  <div id="footer"></div>
</div>

这些div中是否有内容?如果没有,则需要在其上设置高度。