2013-08-04 97 views
-2

我將不勝感激任何幫助,我可以得到這個問題。我在Ubuntu Linux服務器操作系統上使用xampp。我有一個保存爲template.php的字段。我在template.php上定義了一個包含div類「spcout」的樣式。當我嘗試使用「spcout」時,標籤中的文本應該在網頁的寬度上均勻分佈。不幸的是,這並沒有發生。看來我的div類不知道怎麼讀。我試圖在.html文件中使用相同的代碼,並在本地打開文件時起作用。如果我將相同的html文件上傳到Web服務器上,那麼相同的html文件將無法正確顯示。任何幫助表示讚賞!謝謝。分類不工作在PHP

<style type="text/css"> 
ul 
{ 
    list-style-type:none; 
    margin:0; 
    padding:0; 
} 
li 
{ 
    display:inline; 
} 

div.spcout 
{ 
    display: table; 
    width: 100%; 
} 

div.spcout span 
{ 
    display: table-cell; 
    text-align: center; 
} 
</style> 

<div id="container"> 
<img src="images\baseimage.png"> 

<div class="spcout"> 
<span>code 1</span> 
<span>code 1</span> 
<span>code 1</span> 
</div>  
</div> 
+0

什麼是預期的輸出?你能發佈預期結果的截圖嗎? –

+3

你有錯誤的引號:'type =「text/css」' - >'type =「text/css」' – mishik

+0

引用是正確的。它在我複製並粘貼到這裏時顯示錯誤。 –

回答

0
<style type="text/css"> 

div.spcout span 
{ 
    display: block; 
    text-align: center; 
    float:left; 
    width:100px; 
    height:100px; 
    margin-right:5px 
} 
</style> 

<div id="container"> 
<img src="images\baseimage.png"> 

<div class="spcout"> 
<span>code 1</span> 
<span>code 1</span> 
<span>code 1</span> 
</div>  
</div>