I find that I often want to add some small explanation text that would only be visible as a tooltip ie. when viewer hovers mouse on a word/phrase, because I do not want to clutter the text with extra information that some/most viewers would already know.

Or, if not tooltips, perhaps some other way to have the extra information hidden by default unless opened by a click. (in github there is <details> hidden text </details> for example - and I think this is html5?)

Honestly I'd actually want tooltips within tooltips, but that's just pushing it :D

An example of where I'd use it, I have the following text(but imagine it's unquoted in a post):

I have tested Sysrq to work(eg. help,sync) even when kernel.sysctl=0 (so it's just as the doc above says), if I add kernel boot argument sysrq_always_enabled (note: it doesn't have to be sysrq_always_enabled=1). (to double check, I've also tested Sysrq to NOT work when kernel.sysctl=0 and sysrq_always_enabled is NOT present in /proc/cmdline)

I'd hide (eg. help,sync) on the word work,
then hide (so it's just as the doc above says) on the whole phrase I have tested Sysrq to work(eg. help,sync) even when 'kernel.sysctl=0' and hopefully it would be visible that the text applies to(ie. is hidden for) that whole phrase.
Then I'd hide this:

(note: it doesn't have to be sysrq_always_enabled=1)

on the word

sysrq_always_enabled

that's just prior to it.

Then I'd hide this:

(to double check, I've also tested Sysrq to NOT work when kernel.sysctl=0 and sysrq_always_enabled is NOT present in /proc/cmdline)

on the word tested which is part of the start sentence I have tested Sysrq to work ....

If nesting is allowed, then I'd hide Sysrq+h and Sysrq+s on the words help respectively sync from the already tooltip-ed(or somehow hidden) phrase (eg. help,sync) mentioned above.

You get the picture.

At the same time, if it's a tooltip, I don't want it to go away when user pressed left mouse button, in an attempt to select the text.

EDIT: A caveat of all this being implemented would be that any browser wouldn't be able to search/find text within the hidden/tooltip-ed portions unless they are opened/visible.

  • 2
    I would suggest simply using more words; it seems to me as if you're trying to compress text. It's hard to write clearly, but I'd suggest explaining in an 80/20 fashion: cover the main point, then cover the exceptions/options/etc. That way, all the words are there and searchable. – Jeff Schaller Sep 7 at 16:23
up vote 5 down vote accepted

I don't understand why you would want this. What is the benefit you see? It sounds like it would just make using the page harder for everyone and impossible for mobile users. If you must do something like that, use footnotes.

Alternatively, if you want to have a surprise, you can use spoiler markup:

This text is a surprise!

If you start a line with >!, you get a box like the one above whose contents are hidden until you hover over it (or click on it, on mobile).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .