开发者

How do I make the lower two divs be on the same line?

开发者 https://www.devze.com 2023-03-02 14:07 出处:网络
http://jsbin.com/egobu3 I tried pu开发者_如何转开发tting display:inline, but this had the side effect of shrinking the divs. Basically I want one wide bar, and two narrower areas below that will toge

http://jsbin.com/egobu3

I tried pu开发者_如何转开发tting display:inline, but this had the side effect of shrinking the divs. Basically I want one wide bar, and two narrower areas below that will together be the same size.


Simply add float: left to .b and .c.

.b, .c {float: left}

http://jsbin.com/egobu3/2


Alternatively, add display: inline-block to .b and .c:

.b, .c {display:inline-block}

And remove the whitespace in the HTML:

<div class="b">BBBB</div><div class="c">CCCC</div>

http://jsbin.com/egobu3/3

0

精彩评论

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