If you’re not happy with the default monospace, whitespace-as-in-source, You could try using CSS, I’ve not tried, but I see no reason why it wouldn’t just as CSS can be used to override other browser defaults.
It may do, presumably to support legacy code in the many out-dated sites that exist.
But that is not a reason to still be using obsolete code.
It has been removed from the html spec, so there it so guarantee it will continue to be supported. Without even going into the fact it makes for some pig-ugly code.
It was dropped for a reason, a good reason.
CSS is for style.
HTML is for content and structure.
Well coolhead, you may be right, but I’ve been coding web-pages since the Web was born in December 1991, and I do what works for me. I realize this is a Learning Center, and thought I’d address an old topic with old ideas - that still work.
Things have progressed a long way since then. Did you read the link I posted?
Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Usage note:
Do not use this element! Though once normalized in HTML 3.2, it was deprecated in HTML 4.01, at the same time as all elements related to styling only, then obsoleted in HTML5.
Starting with HTML 4, HTML does not convey styling information anymore (outside the element or the style attribute of each element). For any new web development, styling should be written using CSS only.
The former behavior of the element can be achieved, and even better controlled using the CSS Fonts CSS properties.
And you are or course free to code in any way that suits you, but the question was:-
Well Mittineague, that’s interesting, but I still haven’t found a way to apply “size” to pre-/pre using CSS. That’s what other respondents are suggesting. Show me, and I’ll adopt it.
I assume you meant </pre> near the end. I certainly don’t want “uppercase”. BUT, it’s a good model. I had 75 .txt files that I wanted to present on the Web, but viewing them as Text made them hard to read, because the font was too small. I had to transform all the files by changing certain characters: &, <, > to their &name; forms. I then had to save them as .html files because as .txt files, they still were displayed as Text, including the html portions…For me, the most expedient way was to use a 5-line wrapper around the Text, 3 in front, and 2 at the end.
<!DOCTYPE html>
<html><body>
<font size="5"><pre>
TEXT GOES HERE
</pre></font>
</body></html>