2016-11-29 53 views
-4

我有HTML文本像格式:如何使p標籤和文字顯示的多行作爲一個整潔的工作臺

<p>Something</p> Some other text here. 
<p>Something</p> Some other text here. 
<p>Something</p> Some other text here. 

現在,當我在瀏覽器中顯示它它顯示了像:

Something

Some other text here.

Something

Some other text here.

Something

Some other text here.

但是,我想表明它在一個整齊的表格。

像:

Something Some text here.

Something Some text here.

Something Some text here.

這可能嗎?

編輯:對不起夥計們!我認爲它不可能。我要回去工作了。

+1

我不認爲這是可能的純CSS由於事實,其他一些文字不裹在一個元素 – Pete

+0

謝謝皮特!只是想知道這一點。 – rsharpy

+0

如果你想有一個'table' ... **只使用一個**。沒有什麼可恥的......假設這是數據表。否則,也許是一個網格系統。 –

回答

0

添加一些CSS的<p>標籤,

p{ 
    display:inline; 
    margin-right:30px; 
    } 

p{ 
 
    display:inline; 
 
    margin-right:30px; 
 
    }
<p>Something</p> Some other text here.<br> <p>Something</p> Some other text here.<br> <p>Something</p> Some other text here.

+0

對不起兄弟!它現在顯示一切在同一行。 – rsharpy

+0

@rsharpy請運行該代碼段 –

+0

是的,很奇怪,它不工作我的網頁上,可能有些樣式是相互矛盾的。 – rsharpy

相關問題