<

Learn how to a build a cloud-first strategyRegister Now

x

Changing Text Highlight Color in CSS

Posted on
6,177 Points
177 Views
Last Modified:
Experience Level: Beginner
3:20
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
Comment
0 Comments

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Join & Write a Comment

Suggested Videos

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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…
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month