javascript - How to select text background color after adding ID in front of ::selection, how to make it compatible with browsers?
给我你的怀抱
给我你的怀抱 2017-05-19 10:36:57
0
2
495

Select text background color

 ::selection { background-color: rgba(222,169,19,1.00) }

When <html id="c-1">,

#c-1 ::-moz-selection { background-color: rgba(222,169,19,1.00) }
#c-1 ::selection { background-color: rgba(222,169,19,1.00) }

It only works on Firefox, but not on Google Chrome.
Tried it

#c-1 ::-webkit-selection { background-color: rgba(222,169,19,1.00) }

is of no use either. The desired effect is that when replacing the ID in HTML, the background color of the selected text will also be replaced. How to write it so that webkit can understand it. .


What was originally written is correct. It is estimated that there was an error elsewhere and the problem has been solved.

给我你的怀抱
给我你的怀抱

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!