一格,宽度为100%,一行中固定有两个格 [英] one div with 100% width and two fixed divs in one line
本文介绍了一格,宽度为100%,一行中固定有两个格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在一行中包含三个div。
I need three divs in one line.
一个div大小为200px,第二个为300px,最后一个div应该为空。
One is size 200px, second 300px and last div should be what's left.
为什么我的上一个div是新行?
Why is my last div in a new row?
<div style="float: left; width: 200px; background: #223355">a</div>
<div style="float: left; width: 300px; background: #223344">b</div>
<div style="float: left; width: 100%; background: #334455">c</div>
推荐答案
其他人说100%是页面的100% width ..但我不同意说普通 CSS不能完成的用户
AS others have said 100% is 100% of page width.. but I disagree with user who says it can't be done with 'plain' CSS
<div style="float: left; width: 200px; background: #223355">a</div>
<div style="float: left; width: 300px; background: #223344">b</div>
<div style="overflow: hidden; background: #334455">c</div>
这篇关于一格,宽度为100%,一行中固定有两个格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文