# Creating Spoiler Text Using HTML Blocks

**URL:** <https://forum.ghost.org/t/creating-spoiler-text-using-html-blocks/59050>\
**Category:** Using Ghost\
**Created:** [July 27, 2025, 4:45pm UTC](https://forum.ghost.org/t/creating-spoiler-text-using-html-blocks/59050 "2025-07-27T16:45:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [July 28, 2025, 11:15am UTC](https://forum.ghost.org/t/creating-spoiler-text-using-html-blocks/59050/2 "2025-07-28T11:15:48Z")

</div>

You could hijack the “highlight” format (ctrl/cmd+alt+h on selected text) within the rich-text editor instead of using a HTML block. Then in your global or post code injection field:

```auto
<style>
mark {
  background-color: black;
  color: black;
  transition: color 0.2s, background-color 0.2s;
  cursor: pointer;
}

mark:hover {
  color: inherit;
  background-color: inherit;
}
</style>

```

There’s no JS needed for this type of hover.

---

_[View the full topic](https://forum.ghost.org/t/creating-spoiler-text-using-html-blocks/59050)._
