In this tutorial, you will learn how to change selected text background color in CSS. Whenever you select a text in your browser to copy or just for highlighting purpose, you must have noticed that it always gives you default blue color in the background. To change this color, you can make use of ::selection pseudo element.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<h1>This is H1 Element</h1>
<p>This is paragraph Element</p>
<div>This is DIV Element</div>