by Cekoviu » Fri Feb 14, 2020 10:28 am
by Trotterdam » Sat Feb 15, 2020 12:51 am
<style type="text/css">
div.spoiler { display:none !important }
input.spoilercheck:checked + div.spoiler { display:block !important }
</style>
<input type="checkbox" class="spoilercheck">Show spoiler
<div class="spoiler">bla bla bla</div>
<style type="text/css">
div.spoiler { display:none !important }
input.spoilerpreface:focus + div.spoiler { display:block !important }
</style>
<input type="text" readonly class="spoilerpreface" value="Click to show">
<div class="spoiler">bla bla bla</div>
by Cekoviu » Sat Feb 15, 2020 3:44 am
Trotterdam wrote:Which browser? On mine, I can right-click and select "Inspect Element", then remove the "display:none" CSS manually.
There are ways to make spoiler boxes work with just CSS alone, such as:or:
- Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilercheck:checked + div.spoiler { display:block !important }
</style>
<input type="checkbox" class="spoilercheck">Show spoiler
<div class="spoiler">bla bla bla</div>Although really old browsers still have trouble with these.
- Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilerpreface:focus + div.spoiler { display:block !important }
</style>
<input type="text" readonly class="spoilerpreface" value="Click to show">
<div class="spoiler">bla bla bla</div>
The really old-fashioned way to do spoilers is to just set the foreground and background colors to the same value, so that the text is only visible by selecting it, which which NationStates already allows you to do (or you can even make it transparent), but just isn't popular in the community because more dedicated spoiler tags exist.
Users browsing this forum: Baharan, Bisofeyr, Caral-Supe, Countriopia, Dimetrodon Empire, Geopolity, Khantin, Libertas Minor, Planetary Soviet Socialist Republics, Shirahime, Xoshen
Advertisement