coding180 icon


HTML Element <pre>

HTML Element <pre>

Tutorials > HTML > HTML Elements

The HTML "pre" element allows us to display all the information that is contained between the start and end marks just as we have written it, respecting even the blank spaces and line breaks.

Let's see how the information contained within this tag is displayed in a browser:

  <title>page title</title>
  <meta charset="UTF-8">
<h1>HTML pre tag</h1>
 select * from publishers
    left join books
    on editoriales.codigo=books.codigoeditorial;

The result in the browser is:

Html pre tag example -

Normally, if we do not apply CSS to the pre tag, the data appears with a monospaced font, that is, each letter occupies the same width in pixels.

If instead of having the pre tag we use the paragraph tag <p>, the result inside the browser is completely different:



Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel