2017-01-08 14 views
-1

添付文書のように字下げをしたい。私は試しましたHTMLの字下げ

<style type="text/css"> 
.tab { margin-left: 40px; } 
</style> 

echo "<strong> Introduction: </strong> 
<p class='tab'> 
This is the introduction. This is the introduction. This is the  introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. 
</p>"; 

enter image description hereしかし、望ましい出力は得られません。私は別のパラグラフを望んでいません。助けてください。

+0

申し訳ありませんが、...何がやりたいん理解できないのですか? – Danielius

答えて

0

強い要素には浮動小数点を置き、p要素には余裕をもたせます。これは強い要素のテキスト幅と同じかそれ以上でなければなりません。

<style type="text/css"> 
 
.tab { margin-left: 100px; } 
 
strong {float:left;} 
 
</style> 
 

 
<strong> Introduction: </strong> 
 
<p class='tab'> 
 
This is the introduction. This is the introduction. This is the  introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. This is the introduction. 
 
</p>

関連する問題