::selection - CSS pseudo selector

::selection - CSS pseudo selector

You can change the background color and color of selected text by styling ::selection.

Styling this pseudo element is great for matching user-selected text to your sites color scheme.

You can style ::selection on individual elements. You can also style the entire page by dropping the bare pseudo-element in your stylesheet.

There are only three properties that ::selection will work with:

  • background
  • color
  • text-shadow

One of the most helpful uses for ::selection is turning off a text-shadow during selection.

要查看或添加评论,请登录

Milap Patel的更多文章

社区洞察

其他会员也浏览了