开发者

How to make CSS float left not bend around when browser width is shrunk

I have 2 div boxes. It's all working fine but when the browser is shrunk to less than 800 pixels or so, the second div moves underneath the first div. How can I force it to always stay to the right of it?

#testbox1 {
background-color: #0000ff;
min-width: 300px;
width: 30%;
height: 200px;
position: relative;
float: left;
}

#testbox2开发者_高级运维 {
background-color: #00ffff;
width: 500px;
height: 200px;
position: relative;
float: left;
}


Give the parent element a min-width: 800px;.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜