Trouble customizing highlight short code

Hi, I’ve been trying to play with the highlight short code to allow me to easily highlight words or sections of text - much like I did with the convert plus modal linked below.

For some reason, even when i try to add the style elements to the shortcode as I’ve found in other help topics, it defaults to my link color (turquoise) and white text instead of the yellow color I’d like to use.

what would I need to use with normal text and with headers to easily get this effect. Yellow highlight and black text.

Hello @jeanetteleblanc,

Thanks for writing in! What is the name or plugin for the highlight shortcode? We would like to inspect it and test the shortcode with the shortcode element. Please be advised that the text element has it’s own styling. It maybe overridding the styling of the shortcode which maybe why it does not work. We need to check it.

You might want to share your site details so that we can take a closer look. You can provide the login details in a secure note in your next reply. To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Cheers.

It’s just the [highlight]texthere[/highlight] short code i found in the x documentation

Hi again,

Thank you for providing the credentials. The highlight shortcode by default uses your link color as the background. To customize it simply assign a class to the shortcode e.g custom-highlight so your shortcode will look like this:

[highlight class="custom-highlight"]Text[/highlight]

Then add the following code in the Theme Options > CSS:

.custom-highlight {
  font-weight: bold;
  background-color: #FFD700;
  color: black;
}

You can then use the shortcode like this:

I [highlight class="custom-highlight"]swear like a sailor[/highlight], I've been called a word-witch (more than once), I believe whole-heartedly in [highlight class="custom-highlight"]the power of your voice[/highlight]

To learn more about the highlight shortcode, please see http://demo.theme.co/integrity-1/shortcodes/highlight/

Hope this helps!

I tried the above on this page (just a draft copy of my homepage)

but it does’nt seem to have changed the highlight.
Did i miss something?

Thanks so much

Okay, actually on second attempt it seems to work.

Next question: is there a way to customize the appearance of the highlight so it doesn’t look like a rounded corner button… is there any way to tweak the appearance of that?

Hi again,

You can use the class custom-highlight to change it’s appearance, simply replace the previously given CSS code with the following:

.custom-highlight {
  font-weight: bold;
  background-color: #FFD700;
  color: black;
  border-radius: none;
}

You can add more CSS rules to this class to customize the appearance of the highlight shortcode. If you would like to learn CSS, I am sharing few resources that you take a look to get started with CSS and an interesting tool that you can use to speed up the development process.

I recommend you to watch following video that will help you to get started with CSS.

https://www.youtube.com/watch?v=MFR4WXiLzpc

Sometimes it can get a bit difficult to find out the right selector to be able to write the required CSS codes. A handy tool that can help you in this is Google Chrome dev tools. I am sharing the resource that you can refer to get started with dev tools.

https://developers.google.com/web/tools/chrome-devtools/css/

https://developers.google.com/web/tools/chrome-devtools/

https://www.youtube.com/watch?v=tP_kXBJWPhQ&t=200s

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.