簡體   English   中英

IE7和IE8之間的兼容性問題

[英]Compatibility issue between IE7 and IE8

我有一個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>

謝謝Jeya

添加overflow-x: hidden; 以及您的CSS。

默認情況下,IE7將您的容器視為已overflow: auto 否則,您需要告訴它。 嘗試添加overflow: hidden overflow-y: auto 之前 overflow: hidden overflow-y: auto ,對我來說很有幫助。

試用您的內容。 overflow-y:auto表示“僅在必要時顯示垂直滾動條”。 顯然IE7認為您的內容足夠高,因此需要滾動條。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM