簡體   English   中英

如何為<br>標簽添加空間

[英]How to add space to a <br> tag

我在主<p>標簽中有很多<br />標簽。

我想增加由<br>創建的可視空間(示例邊距頂部和底部)。

<p>
Some text here<br />
Some other text<br />
Some other text
</p>

我可以使用不同的<p>但我必須在我的網站上這樣做。

知道如何增加<br>創造的空間嗎? 非常感謝。

看一下CSS的line-height屬性。

例:

p { line-height: 90%; }

如果您不想使用css,請嘗試使用此代碼。 當你使用樣式時

對於html文件,javascript編程將更喜歡你在Html文件中的命令而不是css文件中的同一個類。

 <p style="line-height: 2.7"> Some text here<br /> Some other text<br /> Some other text </p> <p style="margin-top: 3.5em"> Some text here<br /> Some other text<br /> Some other text </p> <p style="line-height: 0.6; margin-top: 7.0em"> Some text here<br /> Some other text<br /> Some other text </p> 

我希望我的回答對你的問題有幫助。

最好的祝福,

瓦哈卜

您需要使用line-height屬性。

p {line-height:70px}

我認為br標簽不僅僅是換行符。 為什么要嘗試編寫一個解決問題的代碼。 如果您不能使用任何建議的答案,我會說只使用多個br標簽。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM