Question

I am using css selection selector on my blog to override the default behaviour of browser text selection.

The code I use for CSS is given below.

::-moz-selection { background: #ea0000; color: #fff; text-shadow: none; }
::selection { background: #ea0000; color: #fff; text-shadow: none; }

It works on Firefox and IE, but when using Chrome the selection overflows to other areas. Any ideas?

Here's how to test my problem from my blog: semihyagcioglu.com

Was it helpful?

Solution

You need to hide the overflow on your article elements:

article {
    overflow: hidden;
}

Example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top