CSS select a class containing plus sign "+"

css, css-selectors

Solution

You'd need to escape the plus sign as it has a special meaning in CSS, by using a leading backslash `\` as follows:

.frme_150\+1 {
    background-position: 150px 1px;
}

Working Demo.

Or escape the `'+'` to `'\2b '` or `'\00002b'` (six hexadecimal digits)

Also, you can achieve this by using CSS Attribute Selector:

[class="frme_150+1"] { background-position:150px 1px; }

Working Demo.

Problem

How can I select an element by class name containing a plus sign `+`? E.g. ``` .frme_150+1 {background-position: 150px 1px;} ``` The plus value is changed by using JavaScript, is this possible to use `+` character in selector name?

Original source