Casa > H > How To Insert A Blank Line In Html

How to insert a blank line in HTML

There are a lot of good responses, and some other not so good. But I will sumarize.

Depends on what do you need and what do you need it for.

First, the wrong aproach.

You should not use a blank paragraph

  1. Hi, I am a paragraph

     
  2.  

     
  3. I am another

     

because you do not get a blank line, you get a blank paragraph.

Some options. Real blank line on a paragraph.

The specific tag to do that in html is the
tag but you need to use two of them. The first one interrupts the current line, the second one gives you this extra blank line.

  1. Hi, I am a line
     


  2.  
  3. I am another line. 

But this should be used if you really mean “blank” line. But I can not think on where you need this case.

Note.
NÃO é depreciado, tem um significado semântico muito específico: https://www.w3.org/TR/html51/textlevel-semantics.html#the-br-element
Um uso dele é, por exemplo, um poema, onde você precisa enviar um novo verso para uma nova linha, mas mantendo-se no mesmo parágrafo.

Table

Se você precisar dele em uma tabela você pode simplesmente deixar a respectiva

vazia. Provavelmente você precisa deixar toda a td de uma linha vazia. Você poderia usar colspan então você só usará 1 td.

Com CSS

Isso depende de onde você quer esta linha em branco. Você pode usar a unidade em para que esta dimensão reaja à dimensão do texto em que você está trabalhando.

  • No final de um parágrafo você pode deixar uma margem ou padding.
  1. p {margin-bottom: 1em;} 
<
  • entre linhas de um parágrafo. (Você pode usar também %)
  1. p {line-height: 2em;} <
  2. p {altura da linha: 200%;} 
<
  • Se o seu texto estiver usando a pré-rotulagem, você simplesmente coloca uma linha em branco usando a tecla enter.
  1.  
  2. This is a line 
  3.  
  4. This is another line 
  5.  

An aditional option, if you for some reason are using a programming language, you can escape the new line twice, as a simmilar case of the
tag. These can be on a single row, I am formating it like this, simply to make it clear.

  1. This is a line /r/n/ 
  2. /r/n 
  3. This is another line. 

So.

H

A

V

E

F

U

N

De Moriarty Akiyama

Qual é a melhor abordagem para resolver os palpites? :: Porque é que o Wordpress é tão popular?