Pregunta

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

¿Fue útil?

Solución

You need to hide the overflow on your article elements:

article {
    overflow: hidden;
}

Example

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top