Adding custom style to a Wiki page using MarkDown

Hi there,

I’m trying to reproduce this example

I’m writing this block in the content of the page

.purple {

.purple:hover {

Hey! Hover the cursor over me and guess what?! :)
{: .purple}

But when I go to the content preview it doesn’t work.

What I’m doing wrong?

Thank you.