溢出?随着容器尺寸变大,元素被推出

当我将“.container”中的css从“width:800px”更改为“width:1900px”时,所有元素都会出现重击。而橙色盒子则保持向左倾斜而不是居中。任何人都知道这是为什么发生?我的朋友说这可能与溢出有关,但他不确定。

图片1:宽度:1900px

图片2:宽度800px HTML:点击

        <div id="orangeBox">

            

            <div id="snappyText">
                
Ever think,"Where are the most mediocre places to eat around here? I want me some of that."

</div> <div id="response">
Yeah, neither do we.

</div> White Line iPhone Video Screenshot App Store <div id="explanatoryText">
Dash is the quickest way to find good places to eat. In a world with too many choices and too much information, Dash clears the clutter and offers only the best in your area.

</div>
            twitter

            facebook

        </div><!--end orangebox-->
    </div><!--end container-->

CSS:

body{
    background: url(images/grayBackground.png);
}

/*orangeBox*/

#orangeBox{
    background-image:url(images/orangeBackground.png);
    background-repeat:no-repeat;
    position:relative;
}




.container{
    width:800px;
    margin:0 auto;
    position:relative;
}

width:1900px

width:800px

0
额外 编辑
意见: 1
代码中没有#container开始标记。
额外 作者 Federico Giust,

1 答案

你为什么不改变你的CSS这一点

min-width:800px;
    width:auto;

尝试它是否有效。

0
额外