Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS selector with doublepoint? [duplicate]

how can i select div?

<div id="languageForm:j_id427:0:j_id432">Test</div>

this code does not work

#languageForm:j_id427:0:j_id432 { color:#00aa00; }

. . . . . . . . . . . . . . . . . . .

like image 798
user2306309 Avatar asked Jan 13 '23 21:01

user2306309


1 Answers

: is a special character in CSS (:hover)

Use \00003A to escape it:

#languageForm\00003Aj_id427\00003A0\00003Aj_id432 { color:#00aa00; }

jsfiddle

Note: Don't use \: because it doesn't work in IE7.

Why the many 0s? Because the browser will try to read at most 6 characters to parse a unicode constant in CSS files. Without the zeros, it would read \3Aj and stop with an error.

like image 78
Aaron Digulla Avatar answered Jan 16 '23 00:01

Aaron Digulla