Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

HTML

Hey, could someone help? I need to know, what's the HTML for a spoiler?

LIke the

...

type.

How can they be done using HTML?
 
Here's yours in HTML:

Code:
<div>
    <div class="pre-spoiler">
    <span style="float:left; padding-top: 2px;">insertspoilernamehere <input type="button" value="Show" style="width:80px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Show';}">
    </div>
    <div>

        <div class="spoiler" style="display: none;">

...

</div>
    </div>
</div>

If you are using FireFox, just click on View -> PageSource
 
Twar3, the forum's use of a spoiler div utilizes a CSS sheet, so that won't work on an HTML document that isn't attached to that sheet. Thus, it won't work.
 
Hmm... It seemed to work on my guild wars site. Within CuteNews articles. And since I coded the actual layout, I would know if there was any JScript inplemented for it. I don't even use CSS.

EDIT: Tested the code in a new file with NVU. Spoiler is there, no JScript in the code, and no CSS. Although it's just the spoiler text, the button and the content.
 
I tried it in a blank notebook document, it seems to work. But, the styles do not work as they have to be defined in the CSS stylesheet (as people have said, except it is just the styles that don't work, and the border).
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top