-1

重複の可能性:
Internet Explorer が、overflow:hidden を含む div 内のコンテンツを非表示にするのはなぜですか?

内部のコンテンツ<div class="item">は Internet Explorer では表示されなくなりますが、他のすべてのブラウザーでは表示されます。なんで?この質問は、回答を受け取っていない以前の質問の修正版です。たぶん、私の変更により、可能な解決策に近づきましたか?

HTML:

<td class="table_class">
    <div class="relative">
        <div class="relative">
            <div class="absolute">
                <div class="item_container">
                    <div class="item">
                        // there may be several of these divs
                    </div>
                </div>
            </div>
        </div>
    </div>
</td>

CSS:

.table_class {
    vertical-align: top;
    position: relative;
    z-index: 2;
    padding: 0;
}

.relative {
    height:100%;
    width:100%;
    position:relative;
}

.absolute {
    position: absolute;
    top: 25px;
    right: 5px;
    bottom: 5px;
    left: 5px;
    overflow: hidden;
}

.item_container {
    height: 16px;
    font-size: 12px;
    clear: both;
    white-space: nowrap;
    margin-bottom: 1px;
}

.item {
    position: relative;
    z-index: 999999;
    background-color: transparent;
    float: left;
    text-align: left;
    clear: both;
}

私は何が欠けていますか?(はい、class="relative" の 2 つの div が必要です)。

4

1 に答える 1

0

CSS クラスにwidthandheightを追加してみてください。.absolute

.itemまた、クラスに と の両方がfloat: left;あるのはなぜclear: both;ですか?

clear: both属性を削除し、代わりに兄弟divitemdiv に追加し、次のようにスタイルclear: bothを追加することをお勧めします。

<div class="item_container">
    <div class="item">
        // there may be several of these divs
    </div>
    <div style="clear: both;"></div>
</div>

これがうまくいかない場合は、クラスにwidthand も追加してみてください。height.item

于 2012-12-08T04:39:58.520 に答える