-1

考虑这个页面: http: //losthobbit.net/temp/docking.html

这是HTML:

<html>
<head>
    <title></title>
</head>
<body>
    <div style="position: absolute; bottom: 0; right: 0; top: 0; width: 259; background-color: #00FF00">
        <input type="button" style="position: absolute; left: 161; top: 30; width: 75; height: 25"/>  
    </div>    
    <div style="position: absolute; bottom: 0; right: 259; left: 0; height: 100; background-color: #00FFFF">
        <input type="button" style="position: absolute; right: 10; top: 30; width: 75; height: 25"/>  
    </div>
</body>
</html>

在 Chrome 和 FireFox 中,这非常有效。第二个 div 停靠在第一个 div 上。

是否有可能让它在 IE8 中工作?

提前谢谢你,很棒的人:)

4

2 回答 2

1

将单位(例如“px”)添加到您的 CSS 值。IE 更喜欢这种方式,不像 FF 或 Ch 那样宽容:)

于 2011-06-02T12:43:45.730 回答
1

http://jsfiddle.net/X2QYs/

试试这个,做你所要求的。

不知道为什么你会想要这样做,这不像我以前见过的任何网页设计。

于 2011-06-02T12:52:02.917 回答