Changing the text selection background color and the selected text color

Solved6 replies4 participantsUpdated by Tony Rodriguez

  • Avatar: st7878
    st7878
    Participant

    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

    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

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

    Avatar: Ayan Rahman
    Ayan Rahman
    Support staff

    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

    Super, thanks!

    Avatar: st7878
    st7878
    Participant

    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

    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

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