开发者

weird CSS problem? positioning div elements using float property

In dreamweaver when I enter this html:

<div style="float:left;width:100px;height:20px">a</div>
<div style="float:left;clear:left;width:100px;height:100px">b</div>
<div style="float:left;width:80px;height:100px">c</div>

div c appears to be aligned to the top along side the top of div a. This is how I want it to display, however when rendered in a browser (firef开发者_StackOverflow社区ox, ie tested) div c is below div a and aligned to div b instead. How can I fix this?


This appears to be a bug in Dreamweaver.

Elements do not float up past a clearing element in the same context.

It sounds like you want:

<div style="width: 100px; float: left;">
    <div style="height:20px">a</div>
    <div style="height:100px">b</div>
</div>
<div style="float: left;width:80px;height:100px">c</div>


Hard to guess the layout you want from your description:

Try this and let me know...

<div style="float:left;width:100px;height:20px">a</div>   
<div style="float:left;width:80px;height:100px">c</div>
<div style="clear:both;width:100px;height:100px">b</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜