2012-07-22 46 views
1

在Firefox/Chrome瀏覽器/歌劇/ ETC,這個CSS的偉大工程和3列並排。在IE上,列是垂直的,並不是並排的。IE不顯示3抹灰節正確

什麼是一個簡單的辦法/破解這個?謝謝!

<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> 
+0

你指的是什麼版本的IE? – j08691 2012-07-22 16:42:46

+0

html5標籤不適用於IE8及更低版本。嘗試部分{display:block;} – 2012-07-22 16:45:47

+0

@Shadow_boi display:block;是不足夠的。然後該部分或其他元素仍然沒有任何功能性。我的anwser解決了這個問題 – RTB 2012-07-22 16:49:32

回答

1

你可以在你的頭一節使用這個腳本:

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

IE 8 <不承認section元素。問題在於瀏覽器對於他們根本不認識的標籤有特殊的處理方式;基本的東西,如風格被應用和能夠包含子項目將無法正常工作。

+0

工作!謝謝(你的)信息 – user1062058 2012-07-22 16:53:00