我想创建一个网页,其中有2个彼此相邻的灵活的div。所以当浏览器窗口压缩在一起时,每个div都会随着浏览器的宽度而缩小(直到某个点)。我遇到的问题是,在下面的解决方案中,当浏览器窗口变得足够小时,div不会缩小,而只是在它们之间断开...把两个灵活的div彼此相邻
我知道我错过了简单的东西。 ..只是不知道它是什么:
<html>
<body>
<div style="border-style:solid;border-color:green;max-width:100%;overflow: hidden;">
<div style="float:left;border-style:solid;border-color:red;background-color:transparent;padding:15px 30px 0px 30px;min-width:100px;max-width:100%">This is a sample text to fill the space so that it can be looked at in a realistic way.</div>
<div style="overflow: hidden;float:right;border-style:solid;border-color:yellow;min-width:100px;max-width:100%;max-height:100%;">This is a sample text to fill the space so that it can be looked at in a realistic way.</div>
</div>
<body>
</html>
感谢,它的工作!显示:外面的表格,显示:表格:左边内部的单元格,并且移除浮动解决了问题 – rockit