Selection Selector using CSS

<!DOCTYPE html>
<html>
<head>
<style>
::-moz-selection { /* Code for Firefox */
color: blue;
background: yellow;
}

::selection {
color: blue;
background: yellow;
text-shadow: 2px 2px 2px grey;
}
</style>
</head>
<body>

<h1>Select some text on this page:</h1>

<p>Hello World How Are You.</p>
<div>This is some text in a div element.</div>

<p><strong>Note:</strong> ::selection is not supported in Internet Explorer 8 and earlier versions.</p>

</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *