Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.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
Html 重复-x不';t工作-css_Html_Css - Fatal编程技术网

Html 重复-x不';t工作-css

Html 重复-x不';t工作-css,html,css,Html,Css,我对repeat-x有一个问题。我的css代码如下: #header { } #header_left { background:url("../img/header_l.png") no-repeat; float:left; width:341px; height:258px; } #header_content { background:url("../img/header_c.png") repeat-x; width:32px; height:258px; float:left;

我对repeat-x有一个问题。我的css代码如下:

#header {
}

#header_left {
background:url("../img/header_l.png") no-repeat;
float:left;
width:341px;
height:258px;
}

#header_content {
background:url("../img/header_c.png") repeat-x;
width:32px;
height:258px;
float:left;
}

#header_right {
background:url("../img/header_r.png") no-repeat;
float:right;
width:341px;
height:258px;
}
和html代码:

<div id="header">
        <div id="header_left"></div>
        <div id="header_content"></div>
        <div id="header_right"></div> 
    </div>

但是图像头_c.png只重复一次。我如何解决这个问题


这是屏幕截图:,header_c.png重复一次,然后留下空白。

您的意思可能是查看HTML元素的维度。

如果我理解正确,您的错误是间隙获得的中间块和右侧块之间的错误。您可以通过设置右块
float:left
或更改中心块的宽度来解决此问题

-我的例子和你的错误

-使用
float进行修复:左


-使用中心块的精确大小进行修复

可能是您应该试试这个

#header {
margin: 0 auto;
height:auto;
width:auto;
padding:0px;
}

#header_left {
background:url("../img/header_l.png") no-repeat left top;
width:341px;
height:258px;
}

#header_content {
background:url("../img/header_c.png") repeat-x left top;
width:32px;
height:258px;
}

#header_right {
background:url("../img/header_r.png") no-repeat left top;
width:341px;
height:258px;
}

“重复一次”是什么意思?
标题内容{width:32px;}
-看起来很窄。你能提供一个屏幕截图吗?如果没有原始图像,几乎不可能看到症状……此外,您是否可以提供您正在使用的实际图像,因为它将有助于查看是否有可能影响此的空白。
header_c.png
?这是一个问题![在此处输入图像描述][1][1]:页眉_c.png重复一次并有空位置。中间块的宽度为32px。您将显示一个中心块宽度相同(32px)的屏幕。尝试更改中心块的宽度,您将看到header_c.png如何平铺整个块为什么要更改中心块大小,必须重复中心块本身??