This custom code modification allows you to control the appearance of selected text across different browsers, enhancing the visual experience of your website.

https://prod-files-secure.s3.us-west-2.amazonaws.com/c08e9cc9-3d03-4977-82a4-2278b0c13abd/597bd7a3-558e-4450-96b4-e91b781cdf3c/text-selection-1.png

Default configuration

The selectors use the following Webflow Variables:


Customization options

  1. Using Webflow variables (Recommended):
  2. Using custom colors:

https://prod-files-secure.s3.us-west-2.amazonaws.com/c08e9cc9-3d03-4977-82a4-2278b0c13abd/9901d76c-8c5a-49e6-a650-d6017510747a/text-selection-2.png

Example of custom color selection (using HEX colors):

/* Customize text selection for Mozilla browsers */
::-moz-selection {
  color: #FFFFFF !important;
  background: **#B658FF**;
  text-shadow: **0 0.5px 1.5px rgba(0, 19, 88, 0.3), 0 2px 5px rgba(0, 19, 88, 0.1)**;
}

/* Customize text selection for other browsers */
::selection {
  color: #FFFFFF !important;
  background: **#B658FF**;
  text-shadow: **0 0.5px 1.5px rgba(0, 19, 88, 0.3), 0 2px 5px rgba(0, 19, 88, 0.1)**;
}

https://prod-files-secure.s3.us-west-2.amazonaws.com/c08e9cc9-3d03-4977-82a4-2278b0c13abd/0b2a859f-ddef-436f-a5a3-b612969992ff/text-selection-3.png