2014-03-31 54 views
0
<div style="text-align:justify; text-justify:newspaper;width:300px;height:200px;border:1px solid"> 
<p> 
We are a mix of young, energetic individuals mentored by experienced seniors who as a team are passionate about continually moving out of our comfort <br> zones. 
some text 

</div> 

我在網頁上添加了大量文本。我無法根據理由調整文本。 從左側可以,但在右側,它不好..請告訴我的變化。 我要添加文本像以報紙形式..如何在div標記中調整文本的對齊方式

+1

文字看起來合理的給我您發佈的例子。 –

+0

僅供參考'text-justify:newspaper;'只是IE瀏覽器,所以最好避免更多的可能 – SW4

+0

它只會看起來像jsfiddle ...不在我的瀏覽器上,爲什麼會這樣? –

回答

0

試試這個:http://jsfiddle.net/945cn/1/

你有一個隨機的,不需要<p>標籤沒有關閉</p>標籤,所以我刪除它。此外,我建議不要使用內聯css並將CSS放入樣式表中,如我在JSFiddle中所示。讓我知道這是否適合你。

HTML:

<div class="justified"> 
    We are a mix of young, energetic individuals mentored by experienced seniors who as a team are passionate about continually moving out of our comfort 
    <br>zones. some text 
</div> 

CSS:

.justified { 
    text-align:justify; 
    width:300px; 
    height:200px; 
    border:1px solid 
} 
+0

非常有趣...你的代碼和我的代碼沒有什麼區別 –

+0

我刪除了p標籤,並且將你的樣式設置爲類而不是內聯。它適合我在所有瀏覽器上顯示。也許你有衝突的CSS? –