Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double line break HTML tag

I am creating a website and I find myself doing </br></br> a lot in order to create a new paragraph looking like this...

Paragraph 1

Paragraph 2

I have already created a <tab> tag to indent paragraphs but I am wondering if I could create a <break> tag and in puts in two new lines to save me some time.

Can anyone point me in the right direction?

Thanks!

-Henry

like image 768
Dummy Code Avatar asked Jun 21 '13 18:06

Dummy Code


People also ask

How do you do a double line break in HTML?

To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break.

How do you add two lines in HTML?

To add a line break to your HTML code, you use the <br> tag. The <br> tag does not have an end tag. You can also add additional lines between paragraphs by using the <br> tags. Each <br> tag you enter creates another blank line.


2 Answers

If <p> are not needed semanticly(?), you may change <br/> defaut values:

br {
  margin:2.5em 0;/* FF for instance */
  line-height:5em;/* chrome for instance */
}

http://codepen.io/anon/pen/cJwDhI <=here it's 5em, to make it obvious :)

like image 162
G-Cyrillus Avatar answered Oct 17 '22 19:10

G-Cyrillus


Use a <pre> tag. It saves the formatting within.

<pre>
My first line.

My second line after two line breaks.
</pre>
like image 43
Hyperbola Avatar answered Oct 17 '22 18:10

Hyperbola