Burger mobile menu

Text selection styling

Published: 6 Nov, 2015

In CSS3 we are able to change the style of standard (browser default) text selection. You can see it here on CSS-WORKSHOP.COM after selecting some part of text, the background becomes green. It always requires two rules, one for Firefox (with -moz- prefix) and second for other browsers (without prefix).

You can see the examples below or: watch live demo | download example

All selections styling

Using this CSS rules you will style selections on the whole page.

Only paragraph selection styling

You can define different styling for specific elements using ::selection pseudo-element.

Selection styling with text-shadow

To modify selections you can use only a few properties like: color, background, text-shadow (except IE) or outline.

Selection styling without background

You can also make a selection without background.

Watch live demo or Download example

Tags: , ,

Scroll top
Check more tips and apps for developers here. mydevil
Zdjęcie w lewo Zdjęcie w prawo