html - 为什么这个简单的 float 定义列表在 IE7 中不起作用,如何修复它?

标签 html css internet-explorer-7

This is a very simple dl .

HTML

<dl id="photo-attributes">
<dt>Edition</dt>
<dd>200</dd>
<dt>Ratio</dt>
<dd>3:1</dd>
<dt>Location</dt>
<dd>Great ocean road, Victoria</dd>
<dt>FStop</dt>
<dd>F-32</dd>
<dt>Exposure</dt>
<dd>3 minutes 40 seconds</dd>
</dl>

CSS

#photo-attributes {
  margin: 1em 0;
  overflow: hidden;
}

#photo-attributes dt {
  width: 10em;
  float: left;
  clear: left;
  font-weight: bold;
}

#photo-attributes dd {
  float: left;
}

它在除 IE7 之外的所有版本中都能按预期工作。 dd float 在一行上。我不记得这是 IE7 中的什么错误。

我该如何解决这个问题?谢谢

最佳答案

这与 haslayout bug 相关。但毕竟dd不需要左浮动。删除它。

关于html - 为什么这个简单的 float 定义列表在 IE7 中不起作用,如何修复它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3539946/

相关文章:

html - 如何在html中动态创建新行

弹出菜单的 CSS IE 悬停问题

css - IE7兼容的CSS框架

internet-explorer-8 - 使用 IE7、IE8、IE9 和 IE10 中的源映射调试 JavaScript?

html - 如何让子 UL 脱离父 UL

html - 以 flexbox 样式转换的旧容器

html - 背景大小移动图像

html - 如何使 2 张图像(相同高度不同宽度)按比例缩小

css - 如何限制html5数字输入中的最大宽度

javascript - 如何创建一年中每天增加 1/365 部分的圆轮廓?