[Support request] How do I highlight text on a page post?

Home Forums Support [Support request] How do I highlight text on a page post?

Home Forums Support How do I highlight text on a page post?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #780953
    Michael

    How do I highlight several words in a paragraph?

    I would like to highlight them yellow.

    Thanks

    #780954
    Leo
    Staff
    Customer Support

    Hi Michael,

    So you can do this for the HTML content part:
    <span class="highlight">some highlighted text</span>

    Then add this CSS:

    span.highlight {
        background color: #f7f30c; /* Change color accordingly */
    }

    Using one of these methods:
    https://docs.generatepress.com/article/adding-css/

    #781166
    David
    Staff
    Customer Support

    Hi there,

    sorry the orginal CSS in the email had a typo ie. hyphen missing:

    span.highlight {
        background-color: #f7f30c; /* Change color accordingly */
    }
    #781280
    Michael

    Still no luck after trying everything you listed.

    #781282
    David
    Staff
    Customer Support

    Where are you adding the CSS?
    I just added it to the head of the page in browser tools and it works.

    EDIT: Just noticed you added it to an inline style on the following P tag. Remove it from there and add it to Customizer > Additional CSS

    #781284
    Michael

    Ok so I wasn’t adding the CSS to the head of the page. How do I do that?

    #781299
    David
    Staff
    Customer Support

    Just put the CSS;

    span.highlight {
        background-color: #f7f30c; /* Change color accordingly */
    }

    In the Customizer > Additional CSS.

    #781315
    Michael

    I included his short video showing you what I’m doing. Am I missing something?

    https://www.useloom.com/share/2c14ddb26fad4ab38fc8aceb694a5fbe

    #781326
    David
    Staff
    Customer Support

    OK, remove the blocks that you have created. And:

    1. Just add the following markup to your paragraph block:

    <span class="highlight">some highlighted text</span>

    2. Go to Dashboard > Appearance > Customizer > Additional CSS and paste in:

    span.highlight {
        background-color: #f7f30c; /* Change color accordingly */
    }

    Then whenever you want to highlight some text you just need to wrap the content in the span as per point 1.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.