GibboK
GibboK

Reputation: 73918

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.

Upvotes: 3

Views: 8205

Answers (5)

br  {
    display: block;
    content: "";
    margin-top: 20px;
    margin-bottom: 20px;
    }

Upvotes: 1

Wahab Yousif
Wahab Yousif

Reputation: 11

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

Upvotes: 1

Ash
Ash

Reputation: 128

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.

Upvotes: 0

MeLight
MeLight

Reputation: 5565

You need to use the line-height property.

p {line-height:70px}

Upvotes: 0

Bas Slagter
Bas Slagter

Reputation: 9929

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

Example:

p { line-height: 90%; }

Upvotes: 4

Related Questions