Well-formed BBCodes (Todo)
Hi Alex,
thanx!
What I’m really interested in is monospaced text within a single line containing other BBCodes.
Right now you are also using <pre> around <code>. Maybe it’s a solution to prevent the LF for <pre> by setting a class which can by assigned to <pre> in CSS:
.inl { display:inline; }
In other words the block-element is treated as an inline-element.
Just give it a try with this one (valid XHTML):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> div { border:2px solid black; padding:10px; } pre { border:1px solid red; } code { border:1px solid blue; } .inl { display:inline; white-space:nowrap; } </style> <title>pre inline test</title> </head> <body> <div> <pre>Monospaced text, HTML: <pre>foo</pre></pre> <code>Monospaced text, HTML: <code>foo</code></code> <pre class="inl">HTML: <pre>foo</pre>, CSS: display:inline;white-space:nowrap;</pre> </div> </body> </html>
The additional 'white-space:nowrap;' prevents line-breaks and forces scrollbars to be displayed if necessary.
--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)