<

Changing Text Highlight Color in CSS

Posted on
6,307 Points
307 Views
Last Modified:
Published
Experience Level: Beginner
3:19
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS

Video Steps

1. Begin by defining the selected text as an element in CSS by typing "::selection"

2. Style the ::selection element's font color with the "color:" property, the same as any other element

3. Style the selection element's highlight with the "background-color:" property. The default color for most browsers is blue

4. For maximum browser compatibility, copy the entire element's style and instead of "::selection" type "-moz-::selection"

0
0 Comments

Suggested Videos

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month