Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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 Div中的背景图像左侧显示不正确,右侧显示不正确_Css_Html - Fatal编程技术网

Css Div中的背景图像左侧显示不正确,右侧显示不正确

Css Div中的背景图像左侧显示不正确,右侧显示不正确,css,html,Css,Html,我有一个用于在主内容区域周围创建伪着色边框的图像。但是,它将仅显示在内容的左侧,而不是右侧。我知道这不是图像大小的问题,因为我们对页脚使用了类似的图像(以创建装箱外观)。下面是该部分的css,有人能告诉我他们是否看到我需要修改、删除或添加的内容吗?我对做网页前端/设计很陌生,所以如果你还需要什么,请告诉我。Thx #main { background-image: url('../../Content/Images/body_rpt.png'); clear: both; /*add thi

我有一个用于在主内容区域周围创建伪着色边框的图像。但是,它将仅显示在内容的左侧,而不是右侧。我知道这不是图像大小的问题,因为我们对页脚使用了类似的图像(以创建装箱外观)。下面是该部分的css,有人能告诉我他们是否看到我需要修改、删除或添加的内容吗?我对做网页前端/设计很陌生,所以如果你还需要什么,请告诉我。Thx

#main 
{
background-image: url('../../Content/Images/body_rpt.png');
clear: both;  /*add this so tabs go left! */
padding: 15px 15px 15px 30px; /*30px 30px 15px 30px; */
background-color: #fff;
/*border-radius: 4px 0 0 0;*/
-webkit-border-radius: 4px 0 0 0;
-moz-border-radius: 4px 0 0 0;
}
为了便于比较,这里是页脚部分,它工作正常

footer, 
#footer 
{
background-image: url('../../Content/Images/body_bot.png');
background-repeat: no-repeat;
background-color: #fff;
color: #999;
padding: 10px 0;
text-align: center;
line-height: normal;
margin: 0 0 30px 0;
font-size: .9em;
border-radius: 0 0 4px 4px;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
}

我没有看到任何会导致你的主背景图像出现在右边的东西。。。我要做的是创建两个独立的div,比如如果我有body>wrapper>col1,col2,我会做body>wrapper>col1(左边框),col2,col3,col4(右边框),如果我要使用图像作为边框,我会将col1和col4设置为1-2%的宽度

另一种方法是使用浮动,还有一种是使用内置CSS阴影属性(我不知道你的边框是什么样子,使用fiddelr???)

然而,如果我感觉自己真的很新鲜,我会把我的bg图像,在图像编辑器中打开它,把体长+边框(左)+边框(右)作为我的图像宽度,在两侧设置边框,并将其用作我的背景(静态图像方法)