简体   繁体   中英

How to add space to a <br> tag

I have many <br /> tag within a main <p> tag.

I would like increase the visual space created by the <br> (example margin top and bottom).

<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.

Any idea how increase the space created by <br> ? Many thanks.

Take a look at the line-height property of CSS.

Example:

p { line-height: 90%; }

If you no want to use css, try of this code. 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.

 <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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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