开发者

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

开发者 https://www.devze.com 2022-12-26 16:50 出处:网络
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 o

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

精彩评论

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