简体   繁体   English

用css浮动div

[英]Floating over div with css

I have this simple website 我有这个简单的网站

<div style=" position: relative; margin-right: 40px;">
    <div style="float: left; width: 200px; position: relative;">Left Stuff</div>
    <div style="float: left; width: 100px; position: relative;">Middle Stuff</div>
    <div style="float: right; width: 200px; position: relative; margin-right: 40px;">Right Stuff</div>
    <br style="clear: left;" />
</div>

and I want that the "right stuff" float over the "middle stuff" and not under the middle stuff on resize the window. 而且我希望“正确的东西”漂浮在“中间的东西”上而不是在调整窗口大小的中间东西之下。

Currend on resize: 调整大小的Currend:

Left Stuff              Middle Stuff
                               Right Stuff

I want: 我想要:

Left Stuff              Middle SRight Stuff

How can I get this "effect"? 我怎样才能获得这种“效果”?

Change the right div to 将正确的div更改为

<div style="position:absolute; right:0; width: 200px; margin-right: 40px;">Right Stuff</div>

DEMO DEMO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM