Skip to main content

CSS Selection Generator

Create custom text selection styles with the ::selection pseudo-element.
Customize background color, text color, and text shadow.

Select the text below to preview your selection style

The Quick Brown Fox Jumps Over the Lazy Dog

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Try selecting this text to see your custom selection style in action. You can customize the background color, text color, and even add a text shadow for a unique effect.

Format: offset-x offset-y blur-radius color

::selection {
  background-color: #6366f1;
  color: #ffffff;
}

::-moz-selection {
  background-color: #6366f1;
  color: #ffffff;
}

About the ::selection Pseudo-element

Supported Properties

The ::selection pseudo-element only supports a limited set of CSS properties:

  • color
  • background-color
  • text-shadow
  • cursor

Firefox Support

Firefox requires the ::-moz-selection prefix for compatibility. Always include both rules in your CSS to ensure consistent styling across all browsers.

Browser Support

The ::selection pseudo-element is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. It has excellent cross-browser compatibility.