If you are selecting any text in a browser then you will find that the selected text’s background color and color will change so as to indicate that the text is selected. In most of the browsers the background color will change to shades of blue and the color of the text will change to white. In the figure the text ‘Mindfire’ is selected and as we can see the style of the text has changed.
If we want to change the style of selected text then we can do that by writing the following styles.
::-moz-selection // Works for Mozilla { background-color: Orange; color: White; } ::selection // Works for Chrome and Safari { background-color: Orange; color: White; }
After including the floowing styles to our webpage, the selected text will look like: