in reply to Re^5: More CSS-friendly formatting on PerlMonks? (no PRE)
in thread More CSS-friendly formatting on PerlMonks?

The CSS box model seems weird at first, but it's consistent and makes sense. Browsers that "don't have have this 'problem'" are broken. <tt> is an inline element and must not render like block level ones. However, one can simply declare tt.code to be a block element by adding a display: block attribute, since CODE blocks without newlines in them are not given the class="code" attribute. If that ever happens one could still narrow the rule using pre tt.code or some such.

Makeshifts last the longest.

  • Comment on Re^6: More CSS-friendly formatting on PerlMonks? (no PRE)

Replies are listed 'Best First'.
Re^7: More CSS-friendly formatting on PerlMonks? (block)
by tye (Sage) on May 02, 2003 at 14:55 UTC

    Then maybe "display: block" is how people are doing blockish display of code blocks already. I just know I've seen several people do it. I didn't look how they did it. So it probably isn't that there are any "broken" browsers, just difference in what people are trying with CSS.

    For example, thepen uses this:

    tt.code { background-color: #FFFFCC; border: thin black solid; padding: 10px; color: black; display: block; }

                    - tye
      Ah, now I see what you meant. That's what my own CSS does, too.

      Makeshifts last the longest.