I'm trying to target an elements attribute that contains a colon: :
.someclass[xml:lang="da"]
HTML:
<span class="someclass" xml:lang="da">
Is this possible, does not work with above syntax?
CSS has special characters that cannot be applied in class names, so to use them, CSS escapes with a backslash (\)
here is the list of the special characters:
!, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, `, {, |, }, and ~
.someclass[xml\:lang="da"] {
background: red
}
<span class="someclass" xml:lang="da"> text</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With