我有几个使用 position:fixed
的 div
框,我使用 margin-top
和 margin-left
以便将它们放在我希望它们所在的位置。
在 FF/Chrome 上一切都很好,但 IE7 似乎根本无法显示这些框。
我用谷歌搜索了一下,我知道只有 IE7 bet2+ 知道如何正确显示 position:fixed
项。
我正在寻找一种解决方案,使这些框能够在所有 IE7 浏览器上正确显示。有人可以帮忙吗?
代码:(有问题的两个 div 是具有内联样式的)
<div id="rn_PageContent" class="rn_Home">
<rn:widget path="search/ProductCategoryList" data_type="categories" label_title="#rn:msg:FEATURED_SUPPORT_CATEGORIES_LBL#"/>
<div style="float:right;width:310px;background-color:#000;border-style:solid;border-width:1px;border-color:#999999;padding:5px;position:fixed;">
<h2 style="border-bottom:1px solid #BBBBBB;margin-bottom:10px;padding-bottom:2px;">Most popular questions</h2>
<rn:widget path="reports/Multiline2home" report_id="#rn:php:$report_id#" per_page="5" />
<rn:widget path="reports/Paginator" report_id="#rn:php:$report_id#"/>
</div>
<div style="float:right;width:310px;background-color:#000;border-color:#666;border-style:solid;border-width:1px;padding:5px;margin-top:10px;position:fixed;">
<rn:widget path="standard/knowledgebase/PreviousAnswers2" number="3" />
</div>
</div>
谢谢,
最佳答案
position: fixed
元素使用属性 left
和 top
(或 right
和 bottom
) 不带 margin
。
关于html - CSS 位置 :fixed and IE7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5003542/