Menu

gitpiper

Custom text selection css Code Snippet in 2025

visualbeginner

Last Updated: 23 April 2025

Changes the styling of text selection.

  • Use the ::selection pseudo-selector to style text within it when selected.
<p class="custom-text-selection">Select some of this text.</p>
::selection { background: aquamarine; color: black; } .custom-text-selection::selection { background: deeppink; color: white; }

css snippet similar to Custom text selection For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️