我有一个 CSS,它将只显示带有垂直滚动条的内容,而不是水平滚动条。
我的 CSS 是,
div.rightSide {
display: inline;
float: right;
height: 234px;
margin: 5px 0;
overflow-y: auto;
position: relative;
vertical-align: middle;
visibility: inherit;
width: 300px;
z-index: 6;
}
它在 IE8 和 Mozilla 3.6 中按预期工作,但当我在 IE7 中测试时,垂直滚动条也会显示。那么我应该怎么做才能克服这个问题呢?
编辑
添加我的 HTML 代码。
<body>
<div>
<div id="contentColumn">
<div class="overviewPage">
<div class="instructionContent" id="sample_id">
<div class="overviewBackground" style="z-index: 3;">
<p class="sidebar_body">
<img align="center" border="0" height="244"
src="../images/product/sample.jpg" width="752" />
</p>
</div>
<div class="rightSide">
<div class="unitOverview">
<p class="body">
<span class="bold">Unit 1 Overview</span>
</p>
<div class="sectionContents">
<div class="subhead_pri">
<!-- My title goes here -->
</div>
<div class="sectionBody" style="overflow:hidden;width:100%">
<p class="body">
<!-- My content Goes here -->
</p>
</div>
</div>
</div>
<div class="vendor">ID: vendor1</div>
</div>
</div>
</div>
</div>
</div>
</body>
谢谢, 杰亚
最佳答案
也将 overflow-x: hidden;
添加到您的 css。
关于html - IE7和IE8的兼容性问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8416090/