Changing the text selection background color and the selected text color

This topic has 7 replies, 4 voices, and was last updated 1 hour, 15 minutes ago ago by Tony Rodriguez

  • Avatar: st7878
    st7878
    Participant
    April 29, 2026 at 10:31

    When you select text on the frontend of the website with your mouse, in some cases the text itself changes color. Please tell me where in the settings I can change the selection background color and the selected text color?

    Files is visible for topic creator and
    support staff only.
    6 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    April 29, 2026 at 10:48

    Hello @st7878,

    If you would like to modify the colors of all such Advanced headline widgets, please add the following custom CSS to the global CSS section (Theme Options -> Theme Custom CSS):

    .etheme-advanced-headline-mask::selection {  
        color: red;  
        background-color: blue;  
    }

    or

    .etheme-advanced-headline-mask::selection {
        color: #000;
    }

    Frontend example: https://gyazo.com/9633d78660a33b46ccc39c569bd088d1

    If you would like to apply the css locally, only for mentioned widget please, add the custom CSS in Home page Elementor editor -> Advanced heading widget -> Advanced (tab) -> Custom CSS and modify the css with selector prefix, example (https://gyazo.com/d1df49a6894d5f01468dff2ec2b3bda5):

    selector .etheme-advanced-headline-mask::selection {
        color: #000;
    }

    Best regards,
    Jack Richardson
    The 8Theme’s Team

    Avatar: st7878
    st7878
    Participant
    April 29, 2026 at 10:57

    Thank you. It worked, but only for headings. I want it globally for all selectable content.

    Avatar: Ayan Rahman
    Ayan Rahman
    Support staff
    April 29, 2026 at 11:51

    Hi,

    In this case, the next code can be added in Theme Options > Theme Custom CSS > Global:

    
    ::selection {
        background: #eb2728;
        color: #fff;
        text-shadow: none;
    }
    
    ::-moz-selection {
        background: #eb2728;
        color: #fff;
        text-shadow: none;
    }

    Warm Regards,
    The 8Theme Team

    Avatar: st7878
    st7878
    Participant
    April 29, 2026 at 12:39

    Super, thanks!

    Avatar: st7878
    st7878
    Participant
    April 29, 2026 at 12:39

    Thanks for the support! My topic “Changing the text selection background color and the selected text color” has been successfully resolved.

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    April 29, 2026 at 12:39

    Dear st7878,

    It’s great having you in our WordPress & WooCommerce community!

    Every insight you share helps us refine XStore and build tools that empower thousands of online store owners worldwide.

    Together, we grow stronger with every release.

    Topic closed.
    The 8Theme Team

  • Viewing 7 results - 1 through 7 (of 7 total)

The issue related to '‘Changing the text selection background color and the selected text color’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.