Wednesday, 7 September 2016

Website selection text background color change

When you select a text from a website then you will notice that selected text background color will be blue because this is default setting. You can change selection background color for enhance your website user experience . CSS3 include selection style which enable us to accomplish this. Use following code..
selection text background color change

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Girfa Student Help </title>
<style type="text/css">
::selection {
  background: #ffb7b7; /* Global Selection Color */
 
}
.yellow::selection
{
background:#FF0;
}
.green::selection
{
background:#0C0;
}

</style>

</head>

<body>
<p><strong>Girfa Student Help</strong></p>
<p>Global Selection Color. Select for check </p>
<p><strong>Girfa Student Help</strong></p>
<p class="yellow">Red Selection Color. Select for check </p>

<p > <strong>Girfa Student Help</strong></p>
<p class="green">Green Selection Color. Select for check </p>
</body>
</html>

No comments:

Post a Comment