-1
I tried included and require, but they do not respect the line break.
I want to print the file information inside a <p>
, study-only.
-1
I tried included and require, but they do not respect the line break.
I want to print the file information inside a <p>
, study-only.
1
Replace the tag <p>
by the tag <pre>
, so the page will respect line breaks, if the text is not formatted as you want, just set a style to tag <pre>
.
pre{
font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
}
<pre>
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
</pre>
You can make this same tag effect <pre>
using the css
.
p{
white-space: pre;
}
<p>
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
Texto com quebra de linha aqui
</p>
Just arrow the following rule to your css style
white-space: pre;
Thank you very much, it was a very simple solution, I thought I needed to add some more commands in php, but only the tag solved. <pre style="color: red; font-size: 16px;">
 <?php
 include 'text.txt';
 ?>
 </pre>
Browser other questions tagged php javascript web-application include require
You are not signed in. Login or sign up in order to post.
John better describe examples, because the question can be marked as pending
– Bulfaitelo
Place the content inside the <pre></pre>
– Wictor Chaves