2012-01-26 34 views
1

我想在網站模板中進行凍結佈局,但在Internet Explorer中遇到問題。最小寬度不適用於IE凍結佈局

我作出這樣

<div id="NewsBlock"> 
    <div id="aboutUs"> 
     <h1></h1> 
     <span class="OpenDayBanner"></span> 
     <p>You can replace the paragraph above with some text describing your FAQ system. Here's an example: If you have questions about our web site, our products or our services, there’s a good chance you’ll find the answer here</p> 
    </div> 
</div> 

對於CSS我作出這樣

div#NewsBlock{ 
    min-width: 1300px; //this work for Firefox and chrome 
    width:100%; 
    overflow: hidden; 
    height: 510px; 
    background-image:url(../images/aboutstartupbg.png); 
    background-repeat: repeat-x; 
} 

使用最小寬度和百分比值的寬度使得在Firefox和Chrome凍結的佈局,但它不」在IE瀏覽器工作!任何建議請

+0

你是什麼意思被凍結?哪個版本的IE有這個問題? – Jawad

+0

我的意思是在調整窗臺大小時,佈局仍然是凍結的,一些佈局會隱藏,另一個會穩定。 – palAlaa

+0

與stackoverflow佈局相同,請嘗試重新調整瀏覽器的大小。 – palAlaa

回答

0

您必須定義<p>元素的min-width屬性。

實施例:

p.myClass { 
    min-width: 420px; 
    } 
+1

爲什麼呢? Will和p元素會繼承div元素的寬度,它已經有一個最小寬度:1300px? – Jawad

0

的問題是通過改變HTML到XHTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "> 

的DTD求解以

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

    <html xmlns="http://www.w3.org/1999/xhtml"> 
0

使用嚴格的文檔類型,如<!DOCTYPE HTML>,確保IE正確呈現。

還可以考慮將<meta http-equiv="X-UA-Compatible" content="IE=edge" />添加到<head>

+0

它也適用於Transitional文檔類型。這個元數據和這個元素有什麼不同? palAlaa

+0

「有什麼區別」?呃......一切。這是一個完全不同的'http-equiv'。 –

相關問題