-5

内部位置相对 div 我将位置绝对 div 放置在顶部和左侧值,但它在 Internet Explorer 7 中不起作用。请帮助

CSS

.pagi_container {
background-color:#EEE;
border-bottom:1px solid #CCC;
border-top:1px solid #CCC;
height:30px;
margin:0;
width:620px;
position:relative;
}
.pagi_container  form{
position:absolute;
top:5px;
right:10px;
}

HTML

<div class="pagi_container">
<form>
<b>Select your time zone: </b>
<select>
<option  value="America/Los_Angeles">United States (GMT-07:00)</option>
</select>
</form>
</div>
<div class="sort-v3">
<ul>
<li class="first"> <strong>eCard Status</strong> </li>
</ul>
</div>
4

1 回答 1

2

以下内容在 Internet Explorer 7 中按预期工作。确保您的文档类型有效且标记或样式没有错误:

<!DOCTYPE html>
<html>
  <head>
    <title>Absolutely Positioned Elements in IE7</title>
    <style type="text/css">
      .foo {
        position: relative;
        width: 100px; height: 100px;
        background: #f1f1f1;
      }
      .bar {
        position: absolute;
        width: 30px; height: 30px;
        top: 5px; left: 5px;
        background: #CCC;
      }
    </style>
  </head>
  <body>
    <div class="foo">
      <div class="bar">Bar</div>
    </div>
  </body>
</html>
于 2012-05-14T06:08:15.490 回答