DEV Community

Cover image for Simple User Selection Color HTML & CSS
Nikhil Bobade
Nikhil Bobade

Posted on

Simple User Selection Color HTML & CSS

Hello,

Today I choose a very simple topic to how to change a user selection color. The ::selection is a CSS pseudo-element that applies styles to the part of a document or text highlighted by the user.

::selection {
  color: #fff;
  background:#ff8882;
}
Enter fullscreen mode Exit fullscreen mode

As an above example, you can change different colors and it's very useful I hope you like this also comments about your thoughts. For more content follow me on Instagram @developer_nikhil27.

If you want to more support me then buy me a coffee.

Thank you!

Top comments (2)

Collapse
 
lelepg profile image
Letícia Pegoraro Garcez

Cool! I didn't know that.

Collapse
 
nikhil27b profile image
Nikhil Bobade

Thanks also checkout my new post