<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Changing Text Highlight Color in CSS

Posted on
6,237 Points
237 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

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Join & Write a Comment

Suggested Videos

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month