How to change text selection color in the browsers using CSS ? Last Updated : 01 Jun, 2022 Comments Improve Suggest changes Like Article Like Report Most of the browsers by default highlight the selected text in a blue background. This can be changed by using the ::selection pseudo selector in CSS. The ::selectionselector is used for setting the CSS property to the part of the document that is selected by the user (such as clicking and dragging the mouse across text). Only some CSS properties are supported with this selector. These are color, background, cursor, and outline. Syntax: ::selection { // Supported CSS Properties } Example: HTML <!DOCTYPE html> <html> <head> <style> ::selection { color: red; background: violet; } </style> </head> <body> <center> <h1>GeeksForGeeks</h1> <h2> How to change the default text selection color in the browsers using CSS </h2> <p> please select me </p> </center> </body> </html> Output: Supported Browsers: The browser supported by the ::selection Selector are listed below: Apple Safari 3.1Google Chrome 4.0Firefox 62.0 2.0-moz-Opera 10.1Internet Explorer 9.0 Comment More infoAdvertise with us Next Article How to change text selection color in the browsers using CSS ? M manaschhabra2 Follow Improve Article Tags : Web Technologies CSS CSS-Questions Similar Reads How to change the color of selected text using CSS ? The colour of selected text can be easily changed by using the CSS | ::selection Selector. In the below code, we have used CSS ::selection on <h1> and <p> element and set its colour as yellow with green background. Below example implements the above approach: Example: html <!DOCTYPE h 1 min read How to Change Selected Text Background Color in CSS? Sometimes, we need to change the color and background color of the selected text. The ::selection pseudo-element is used to change the background color of the selected text in CSS. This pseudo-element allows you to style the portion of text that has been selected by the user. Using ::selection Pseud 2 min read How to Change the Color of Bullets using CSS? Changing the color of bullets using CSS means styling the bullet points in a list (<ul> or <ol>) to have a different color than the text. This can be done using pseudo-elements or setting the color property on the list item, enhancing design consistency.1. Adding An Extra MarkupBy adding 2 min read How to Change the Border Color on Hover in CSS ? Border color in CSS defines the color of an elementâs border. You can change the border color on hover using the :hover pseudo-class, allowing you to modify the borderâs appearance when a user hovers over the element. Using CSS hover Pseudo ClassThe hover pseudo-class in CSS is a powerful tool that 1 min read How to change the underline color in CSS? In this article, we are going to learn how to change the underline color in CSS, To change the underline color in CSS, use the text-decoration-color property. Set it to the desired color value. Styling is implemented in HTML text to make it catchy and attractive. The text can be made italic, underli 1 min read Like