Jump to content

My Custom Editor Button Isn't Working.


Zanime

Recommended Posts

Posted

SOLVED

 

Seems you cannot use the HTML Paragraph tag (inline).

 

So in short I wanted to create a SPOILER tag that could be used for single words or sentences inline with the current text. However, the button doesn't do what I want it to (change the color of the font with a background color of the same).

HTML CODE


<p class="HFSpoiler">
{content}
</p>

CSS


/*Hide Spoiler Tag */
.hfSpoiler {
  color: rgb(255,255,255);
  background-color: #fff;
  padding: 1px 1px 1px 1px;
}

BUTTON SETTING

5a1cfb52089a5_ScreenShot2017-11-27at9_59_16PM.thumb.png.9bf9cca8b05e5941208762648c923456.png

5a1cfb4f4ed35_ScreenShot2017-11-27at9_59_29PM.png.ee033833f88db7f4c4c92e9f13f2f484.png

 

Now pressing the button after HIGHLIGHTING  your text and pressing it just puts the text in a:


<p>Testing</p>

Ignoring the CLASS that was assigned to that button option style.

Any thoughts?

Posted

It might be because you are selecting an “Inline” replacement, yet your code wants to use a paragraph, which is a “Block” element. 

For an inline change, you would want to use something like <span class="HFSpoiler"> {content} </span>

Posted
9 minutes ago, opentype said:

It might be because you are selecting an “Inline” replacement, yet your code wants to use a paragraph, which is a “Block” element. 

For an inline change, you would want to use something like <span class="HFSpoiler"> {content} </span>

Yes, I figured that out and fixed it already.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...