1

Firefox / Chrome / Opera / Etcでは、このCSSはうまく機能し、3つの列が並んでいます。IEでは、列は垂直であり、並んでいません。

これに対する簡単な修正/ハックは何ですか?ありがとう!

<style>
.col1 {
    float: left;
    width: 270px;
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
}

.col2 {
    float: left;
    width: 270px;
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
    margin-left: 10px;
    margin-right: 10px;
}

.col3 {
    float: left;
    width: 270px;
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
}
</style>

html:

   <body>
    <section class="col1">
        <p>Lorem Ipsum is simply dummy text of 
        the printing and typesetting industry.</p>
    </section>

    <section class="col2">
        <p>Lorem Ipsum is simply dummy text of 
        the printing and typesetting industry.</p>
    </section>

    <section class="col3">
        <p>Lorem Ipsum is simply dummy text of 
        the printing and typesetting industry.</p>
    </section>
    </body>
4

1 に答える 1

1

このスクリプトは、ヘッドセクションで使用できます。

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

IE8<はsection要素を認識しません。問題は、ブラウザがまったく認識しないタグに対して特別な処理を行うことです。適用されるスタイルやサブアイテムを含めることができるなどの基本的なことは機能しません。

于 2012-07-22T16:45:43.840 に答える