简体   繁体   English

如何为<br>标签添加空间

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

I have many <br /> tag within a main <p> tag. 我在主<p>标签中有很多<br />标签。

I would like increase the visual space created by the <br> (example margin top and bottom). 我想增加由<br>创建的可视空间(示例边距顶部和底部)。

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

I could use different <p> but I have to do it in this way in my website. 我可以使用不同的<p>但我必须在我的网站上这样做。

Any idea how increase the space created by <br> ? 知道如何增加<br>创造的空间吗? Many thanks. 非常感谢。

Take a look at the line-height property of CSS. 看一下CSS的line-height属性。

Example: 例:

p { line-height: 90%; }

If you no want to use css, try of this code. 如果您不想使用css,请尝试使用此代码。 when you use style with 当你使用样式时

of Html file the javascript programming will be prefer your order in Html file instead of same class inside the file of 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> 

I hope my answer helped for your question. 我希望我的回答对你的问题有帮助。

best regards, 最好的祝福,

Wahab 瓦哈卜

您需要使用line-height属性。

p {line-height:70px}

I think br tags are for line breaks nothing more nothing less. 我认为br标签不仅仅是换行符。 Why try to write a work-around-ish kinda code. 为什么要尝试编写一个解决问题的代码。 If you can't go with any suggested answers i would say just use multiple br tags. 如果您不能使用任何建议的答案,我会说只使用多个br标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM