Avatar

Well-formed BBCodes (Todo)

by Alfie ⌂, Vienna, Austria, Sunday, May 18, 2008, 18:21 (5793 days ago) @ Alex
edited by Alfie, Sunday, May 18, 2008, 20:53

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: &lt;pre&gt;foo&lt;/pre&gt;</pre>
    <code>Monospaced text, HTML: &lt;code&gt;foo&lt;/code&gt;</code>
    <pre class="inl">HTML: &lt;pre&gt;foo&lt;/pre&gt;, 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β)

locked
15358 views

Complete thread:

 RSS Feed of thread