how to change highlight color in html code example
Example 1: html how to change highlight color
::selection {
background: #ffb7b7;
}
::-moz-selection {
background: #ffb7b7;
}
Example 2: change highlight color html
::-moz-selection {
color: red;
background: yellow;
}
::selection {
color: red;
background: yellow;
}
Example 3: change mouse highlight color js
::selection {
background-color: #352e7e;
color: #fff;
}
::-moz-selection {
background-color: #352e7e;
color: #fff;
}
::-o-selection {
background-color: #352e7e;
color: #fff;
}
::-ms-selection {
background-color: #352e7e;
color: #fff;
}
::-webkit-selection {
background-color: #352e7e;
color: #fff;
}
Example 4: html highlight text
For HTML5: (with 'mark' tag)
<p>Do not forget to buy <mark>milk</mark> today.</p>
In CSS file: (To customize highlight)
mark {
background-color: yellow;
color: black;
}