开发者

Div keeps wrapping when browser size shrinks

How do I stop a div from wrapping/moving below when the browse is resized to the left. everything else on the page stays still except this one box. I want it to not move and force the user to use the browser开发者_JAVA技巧 left right scroll to view it.

#signup_box {
    width: 363px;
    height: 392px;
    float: right;
    margin-right: -34px;
    min-width: 363px;
}


You're floating it. It will wrap. Try positioning it manually, something like:

#signup_box {
    width: 363px;
    height: 392px;
    position:absolute;
    right:34px;
    top:0px;
    min-width: 363px;
}


You have floated the div using float: right;, so it will adjust its position ("float") as necessary.

You can remove the float to stop this behavior, and ensure your page is wide enough to accomodate the width of this (and other relevant) elements.


Try overflow: scroll.


No, There is a simple way to do this...It can work but it is css3. But you can try:

div {
white-space: nowrap;
}

Please reply if it works for you! Thanks! By the way, It will only work if you put it in all elements or just put it in a container. This way, you can put in float without it wrapping

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜