How to break line between php tags with css

Asked

Viewed 71 times

0

I need to break lines between tags php using the css of figcaption, since in the html5 the tag <br> is obsolete.

My code:

<figcaption>
<?php echo $tiporesultado; ?>
<?php echo $imovelpara; ?>
<?php echo "R$" . number_format($priceimovel, 2, ',', '.') ?>
</figcaption>

They said that the clear:both worked, but nothing.

figure.imoveisdestaquesguarapari figcaption{
  clear: both;
}

Only when it runs it stays on the same line, I need each tag php is displayed in a row. In my case, have 3 rows.

  • Would not be display: block;?

  • @Inkeliz It didn’t work out.

  • 1

    Now that I’ve seen, if there are three texts inside that are together. You use <br> in each row to skip line, or you can create multiple paragraphs using <p></p> or else <div></div> for each one. As far as I know <br> is not obsolete, here are examples of uses and nothing appears here, only the attribute clear is obsolete.

  • 2

    Which source claims the tag br is obsolete in HTML 5?

  • 3

    @Gladison use a tag <br> same. It is not obsolete. I believe you read it wrong.

1 answer

2


I don’t know where you got it from, but <br> is not obsolete. Example of use in your code:

<figcaption>
<?php echo $tiporesultado."<br>"; ?>
<?php echo $imovelpara."<br>"; ?>
<?php echo "R$" . number_format($priceimovel, 2, ',', '.')."<br>" ?>
</figcaption>
  • 1

    The character \n will not affect HTML. You need to be the element <br> even.

  • The /n It didn’t work. But the <br> is obsolete in html5. What is the solution?

  • @Gladison Note that it is not /n and yes \n

  • That’s right, I put \n and nothing.

Browser other questions tagged

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