I've seen spoilers presented a number of ways, and wanted to hear others' opinions on the various ways. Something like this: <font color=white>...</font> fails with themes with non-white background.

Even setting the foreground and background at once:

<table bgcolor="#000000"><tr><td><font color="#000000"> ... </font></table>
some browsers will be set to ignore color selections, or make links visible.

There's an interesting technique here: putting the hidden text in a code tag in an HTML comment, and adding a link to a displaytype=code version of the page. I don't know how you would do that without creating the page first and then adding in the link via update, though. And because it is in <code></code> you don't get to have html in the spoiler. Perhaps just a <readmore> section would be preferable.

Some of the answers at How's your perl? are base64 encoded, but that's pretty troublesome to unhide.

Any others? Is there a generic WTDI that would work for all situations that could be documented?


In reply to formatting spoilers by ysth

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.