I agree with JSWolf in this case.
I wouldn't rely on <pre>. Too many readers overflow off the edge of the screen (don't linebreak properly), especially when raising font sizes or reading on skinny screens, etc.
Just rely on simple <p> or <span>, then apply the monospace font to them:
Code:
<p class="terminal">I AM A HUMAN.</p>
<p class="terminal">I AM NOT A ROBOT.</p>
over:
Code:
<pre>I AM A HUMAN.
I AM NOT A ROBOT.</pre>
Back in the 80s/90s, there was a lot of HTML also buried in pre-formatted HTML (manual "justification")... let me tell you, it does not age well on the transfer to modern ebooks/readers.
Note: In ebooks, the only place <pre> + <code>
might be acceptable is actual code blocks (like pasting actual C++ or Java code)... but even there, if I was creating the ebook, I'd likely rely on <p> or images for better compatibility.
(Luckily, I haven't had to do that often. The SINGLE programming book I did create code blocks for, I generated PDFs + SVGs + PNGs of the entire syntax-highlighted code block, inserted in the ebook as an image, then linked to the actual github code. It's a formatting mess that I wouldn't wish on anybody.)