Monday, April 07, 2008

HTML formatting of indented lines

To format a poem on blogger, one need not put tons of "&nbsp;" entities at the head of each indented line; rather, "pre" can be your friend. That is, type <pre>, and everything thereafter is treated as preformatted text, until the corresponding </pre>. For example, if you type :
<pre>
I nunc,
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!
</pre>

the result will look like this:
                       I nunc,
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!
Now if you hate that typeface, you can provide an alternative -- for example <pre style="font-family:sans-serif"> followed by the same text yields this:
                       I nunc,
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!

No comments: