Learn how to override the default text selection color with CSS.
Select the following text:
Default text selection color
Custom text selection color
Use the ::selection
selector to override the default text selection color:
::-moz-selection { /* Code for Firefox */
color: red;
background: yellow;
}
::selection {
color: red;
background: yellow;
}
Try it Yourself »
Tip: Read more about the ::selection selector in our CSS Reference: CSS ::selection Property.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!