<

Changing Text Highlight Color in CSS

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Join & Write a Comment

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month