Easy Tutorial
❮ Css3 Pr Box Flex Group Css3 Pr Animation ❯

CSS3 ::selection Selector

Complete CSS Selector Reference

Example

Make selected text red:


Definition and Usage

The ::selection selector matches the portion of an element that is selected by a user.

::selection can only be applied to a few CSS properties: color, background, cursor, and outline.


Browser Support

IE9+, Opera, Google Chrome, and Safari support the ::selection selector.

Firefox supports it through its private attribute ::-moz-selection.


Complete CSS Selector Reference

❮ Css3 Pr Box Flex Group Css3 Pr Animation ❯