【问题标题】:Can I dock a div against another div in IE 8?我可以将一个 div 停靠在 IE 8 中的另一个 div 上吗?
【发布时间】:2011-06-02 20:52:02
【问题描述】:

考虑这个页面: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 中运行?

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

【问题讨论】:

  • 正如您上次提到的有关此代码的问题:修复您的机器可检测到的错误HTMLCSS 都有问题
  • 抱歉,由于某种原因,我没有看到您的评论。感谢您的帮助。

标签: html internet-explorer internet-explorer-8 docking


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    http://jsfiddle.net/X2QYs/

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

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

    【讨论】:

      猜你喜欢
      • 2017-01-29
      • 1970-01-01
      • 2021-06-16
      • 1970-01-01
      • 2019-02-17
      • 2013-07-02
      • 1970-01-01
      • 1970-01-01
      • 2012-06-24
      相关资源
      最近更新 更多