It is always nice to have a cool UI for our website. Changing the background and foreground color of selection can do wonders sometimes. In this post I will show you how you can achieve that. We can do this easily using CSS3. It provides us with ::selection selector. Safari supports ::selection and firefox supports ::-moz-selection. Webkit browsers supports ::-webkit-selection. With time many browsers have started supporting ::selection itself.
.content::selection
{
background: #E01624;
color:White;
}
.content::-moz-selection
{
background: #E01624;
color:White;
}
.content::-webkit-selection
{
background: #E01624;
color:White;
}
.content
{
overflow:hidden;
}
{
background: #E01624;
color:White;
}
.content::-moz-selection
{
background: #E01624;
color:White;
}
.content::-webkit-selection
{
background: #E01624;
color:White;
}
.content
{
overflow:hidden;
}
In HTML I have div with class as content.
Comments
Post a Comment