How to make the <p> tag divide a text into 4 lines of few characters?

Asked

Viewed 36 times

-4

How to tag

divide a text in sei la 4 lines of x characters instead of the tag go to the end of the screen line??

3 answers

0

Eae Hícaro, you can break lines in your paragraph using the tag
. Example:

<p> Primeira Linha <br> Segunda Linha <br> Terceira linha </p>

0

you can split the texts with <br />. (would be the most grotesque way).

Other alternatives, is to put the <p> inside <div> and style with css at maximum width.

0


To perform line breaking of an HTML text you must use the element <br/> at the end of each line. See the example below:

<p>
    Olá Mundo!<br>
    Este é apenas um simples exemplo de quebra de linha<br>
    Atenciosamente, eu.
</p>

Another way to perform line breaking is by using an element <div> for each line.

<p>
    <div>Olá Mundo!</div>
    <div>Este é apenas um simples exemplo de quebra de linha</div>
    <div>Atenciosamente, eu.</div>
</p>

In both ways that I presented, it is not necessary to break the line in HTML code as I did, as this will make no difference when the browser render the page.

Soon you can perform line breaking with the elements by writing the text in a single line in the HTML document.

<p>
    Olá Mundo!<br>Este é apenas um simples exemplo de quebra de linha<br>
</p>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.