I assume you know how to use CSS in web pages. So let's see the code I used.
::selection {
background: #7f4fcf;
color: #aaccff; /* Chrome and Safari */
}
::-moz-selection {
background: #7f4fcf;
color: #aaccff; /* Firefox */
}
background: #7f4fcf;
color: #aaccff; /* Chrome and Safari */
}
::-moz-selection {
background: #7f4fcf;
color: #aaccff; /* Firefox */
}
As you can see, there are two parts. The first part is for Webkit based browsers like Google Chrome and Apple Safari. The second part is for Mozilla based browsers like Firefox.
The background property specifies the background color of the selection and the color property specifies the text color. As simple as that!
No comments :
Post a Comment