简体   繁体   中英

webview color in android

I have this issue i have tried trough using CSS but this seems to lead me nowhere, here is what I want to do.. I have text displayed in a webview and whenever I select the text I see this: 第一

where the text selected is like in green color.. but I want to change that selected color to orange.. like this.. (photoshoped the image) 在此处输入图片说明

I have tried using CSS in my html like :

<style type="text/css">
::selection {
background: #E02F86;
color: white;
}
</style>

ans also tried with:

<style type="text/css">
*{
-webkit-tap-highlight-color: rgba(255, 0, 0, 255);  
}
</style>

but non of those CSS seem to work. I'm curretly doing this for Android 3.0+ Honeycomb any help would be much appreciated.

I'm having the same problem in my app. It looks like support for this selector has been dropped in CSS3:

Here is the working draft for CSS3 in which they state that it's no longer supported. :/

The ::selection pseudo-element has been dropped since it was dropped from Selectors after testing found interoperability problems and further details to explore/define.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM