我有一个CSS,只显示垂直滚动条而不显示水平滚动条。IE7和IE8之间的兼容性问题
我的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>
感谢, Jeya
你可以把HTML代码?因为我的答案取决于html代码,只适用于类“rightSide”及其容器使用的div,并且如果将css放在容器中会更好。 –
已添加我的HTML代码。 – i2ijeya
谢谢,但是那个名为“instructionContent”的div的div在CSS中有宽度吗? –