Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.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_Position - Fatal编程技术网

Css 背景图像的div位置

Css 背景图像的div位置,css,html,position,Css,Html,Position,在这个网站上,我在左侧添加了一个div,但是当我调整浏览器的大小时,div会显示内容。感谢所有提示试试这个: #bg_right { background-image: url("images/bg_rechts.jpg"); background-repeat: no-repeat; float: right; height: 935px; position: relative; width: 258px; z-index: -1; }

在这个网站上,我在左侧添加了一个div,但是当我调整浏览器的大小时,div会显示内容。感谢所有提示

试试这个:

#bg_right {
    background-image: url("images/bg_rechts.jpg");
    background-repeat: no-repeat;
    float: right;
    height: 935px;
    position: relative;
    width: 258px;
    z-index: -1;
}
#bg_left {
    background-image: url("images/bg_links.jpg");
    background-repeat: no-repeat;
    float: left;
    height: 935px;
    position: relative;
    width: 258px;
    z-index: -1;
}

#wrapper {
    height: 0;
    margin: auto;
    text-align: left;
    width: 1024px;
}

body {
    height: 100%;
    margin: auto;
    width: 1540px;
}

如果你限制身体的宽度,它将像一个符咒一样工作!(:

你使用的是什么浏览器?在chrome甚至IE 9中,我觉得一切都很正常。你能澄清问题吗?我知道左侧的固定div如何导致主要内容出现问题,但你希望它做什么?我想看看背景(左图)在左边的内容旁边没有空格直接在内容旁边谢谢你,Veery!我在右边也遇到了同样的情况有一刻我把带图片的div放在了网上我加上了div的名字bg_右边我怎么能把它加在内容的右边?糟糕的是,我改变了图片的名字。我采取了和l一样的立场eft elementDone,看看我所做的更改,添加“#bg_right”并在#wrapper中添加高度0。可以给我你的电子邮件吗?:)或Facebook?