PullJosh
PullJosh

Reputation: 735

Highlight Background No Transparency in Opera

I have some CSS that changes the background color when you highlight any text on the page:

*::selection {
    background:#083875;
    color:white;
}
*::-moz-selection {
    background:#083875;
    color:white;
}

The problem is that the background color of this text (on highlight) is slightly transparent. Is there any way to make the background completely solid using only css?

This issue is occurring in Opera 25.

Upvotes: 0

Views: 491

Answers (1)

Axel
Axel

Reputation: 10772

In Opera 25, you can't control the opacity of the selection of text.

Even forcing the opacity using the rgba(0,0,0,1) produces a semi-transparent background.

*::selection {
    background: rgba(255,0,0,1);
    color:white;
    opacity: 1;
}

http://jsfiddle.net/j9u9qx8x/1/

Test results in Opera 25
Results In Opera

Perhaps try submitting a support ticket to the Opera development team to see if they can allow this functionality. It makes sense that you should be able to override the transparent effect by forcing the opacity in the rgba() color syntax.

Upvotes: 1

Related Questions