sublime
sublime

Reputation: 4161

On clicking the page divs get selected and turn blue

This is really a vague question and I apologize for that. I'm building an application which is showing/hiding some divs. There are multiple views in application.

In some views, which I start clicking randomly, some div's get selected ( appear as default browser blue selection ) which is really annoying. In some views this behavior doesn't seem to occur. I want to know what might be the cause of this.

( since I don't know the cause it's really hard to create a jsfiddle or something to reproduce this case )

Upvotes: 0

Views: 136

Answers (2)

Turnip
Turnip

Reputation: 36712

I think you are talking about the default text selection colour. Give the following a shot:

::selection {
    background: transparent;
}

I've no idea what browser support is like for ::selection I'm afraid

Upvotes: 3

Dan
Dan

Reputation: 3815

in css:

a, img {  
 border-style: none;
}

i am assuming your divs have javascript attached via a elements?

Upvotes: 0

Related Questions