【发布时间】:2020-02-18 06:22:36
【问题描述】:
我使用这些样式信息使页脚贴在网页底部,它在 FF、Chrome 和 Opera 中非常有效。仅在 IE 中,页脚出现在页面中间而不是底部。
body { margin: 0; padding: 0; height: 100%; font-family: Georgia; }
#parent
{
min-height: 100%;
position: relative;
}
#header { position: relative; left:0px; top:0px; width: 100%; height:45px; background-color: black; }
#content { padding-bottom: 150px; position: relative; }
#footer { position: absolute; left: 0px; width:100%; bottom: 0; height:80px; background-color: black; }
HTML结构如下:
- HTML 正文标记
- 父级
- 标题
- 内容
- 页脚
- 父级
更新
我想如果我为 IE 添加一个条件 this 选择器,它可以在两个浏览器中工作。
#parent { height: 100%; /* min-height: 100%; */ }
现在,有人可以告诉我在作为外部 HTML 文件包含的 .css 文件中添加条件 CSS 注释是否合法?我猜不是。如何在不使用额外的仅 IE 的 CSS 文件的情况下使用此条件注释?
【问题讨论】:
标签: css internet-explorer internet-explorer-8