【发布时间】:2014-07-02 02:10:08
【问题描述】:
目前代码的工作方式是将 iFrame 放在底部的底部。我希望最后两个 iFrame 彼此相邻,以便一个可以容纳,比如说一个菜单,另一个可以容纳另一个网页。它们需要彼此相邻。这是并排的(没有双关语)
有人建议浮动:左。我试过这个,它确实向左浮动,但它把上面的 iFrame 向左浮动,而不是当前的 iFrame。
代码:
<!DOCTYPE html>
<html>
<body>
<iframe src="http://www.w3schools.com" width="600" height="200">
<p>Your browser does not support iframes.</p>
</iframe>
<iframe src="http://www.w3schools.com" width="200" height="500">
<p>Your browser does not support iframes.</p>
</iframe>
//I want this right next to the second iframe that is 400 width
//which would fill the rest of the screen
<iframe src="http://www.w3schools.com" width="400" height="500">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
新代码:
<!DOCTYPE html>
<html>
<body>
<iframe src="http://www.w3schools.com" width="600" height="200">
<p>Your browser does not support iframes.</p>
</iframe>
<iframe src="http://www.w3schools.com" width="200" height="500">
<p>Your browser does not support iframes.</p>
</iframe>
//I want this right next to the second iframe that is 400 width
//which would fill the rest of the screen
<iframe src="http://www.w3schools.com" width="400" height="500" float : right>
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
【问题讨论】:
-
CSS: two columns 的可能重复项