πŸ”₯ NEW Code Tidbit Every Week πŸ”₯

# Custom CSS Selection Styling

Custom Selection Styling is fun! πŸŽ‰

The ::selection CSS pseudo-element allows you to apply styles to your text when it’s highlighted. It's a great way to add some pizzaz to your site πŸ’ƒ

p::selection {
  background: DeepPink;
  color: white;
}

For Firefox, you will need to use ::-moz-selection πŸ‘

p::-moz-selection {
  background: DeepPink;
  color: white;
}

# Resources

  • https://css-tricks.com/almanac/selectors/s/selection/

Related Tidbits