![]() |
Do not use <pre>. If the lines are long enough, and the font large enough, the text will not wrap in some cases.
|
Quote:
Hitch |
Quote:
It's not for paragraphs of prose. It's for PRE-formatted text: where you explicitly put in every linebreak. The use here is probably for a few words of "output": Enter password:_ and the like. But if you might use longer lines, you can also allow wrapping by defining: pre {white-space: pre-wrap;} |
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>Code:
<pre>I AM A HUMAN.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.) |
Quote:
That was just the simplest way to do it. He ignored the rest of my post, which is his SOP. |
Quote:
|
I'd not use <pre>; I'd use an explicit paragraph style.
|
Quote:
At least, that's my experience with it. FWIW. I'm sure that there's some mad CSS out there that would prove me wrong. Hitch |
| All times are GMT -4. The time now is 09:18 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.