Arriva molto tardi a questa festa, ma è possibile utilizzare selettori di attributo.
Nel tuo caso, per indirizzare l'elemento class='a.b'
, è possibile utilizzare:
[class~="a.b"] {...}
// or
span[class~="a.b"] {...}
Inoltre, ecco la lista completa dei selettori di attributo.
Attributo selettore Presente
// Selects an element if the given attribute is present
// HTML
<a target="_blank">...</a>
// CSS
a[target] {...}
attributo Equals Selettore
// Selects an element if the given attribute value
// exactly matches the value stated
// HTML
<a href="http://google.com/">...</a>
// CSS
a[href="http://google.com/"] {...}
attributo contiene Selettore
// Selects an element if the given attribute value
// contains at least once instance of the value stated
// HTML
<a href="/login.php">...</a>
// CSS
a[href*="login"] {...}
Abilità inizia con selettore
// Selects an element if the given attribute value
// begins with the value stated
// HTML
<a href="https://chase.com/">...</a>
// CSS
a[href^="https://"] {...}
Abilità scade Con selettore
// Selects an element if the given attribute value
// ends with the value stated
// HTML
<a href="/docs/menu.pdf">...</a>
// CSS
a[href$=".pdf"] {...}
Abilità Spaced selettore
// Selects an element if the given attribute value
// is whitespace-separated with one word being exactly as stated
// HTML
<a href="#" rel="tag nofollow">...</a>
// CSS
a[rel~="tag"] {...}
Abilità hyphenated Sele ctor
// Selects an element if the given attribute value is
// hyphen-separated and begins with the word stated
// HTML
<a href="#" lang="en-US">...</a>
// CSS
a[lang|="en"] {...}
Source: learn.shayhowe.com
Quale sistema folle genererà un simile nome di classe? – SLaks
Partial dupe, ma probabilmente risponde alla domanda: http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names- –
sistema folle: i nomi delle classi sono chiavi del file delle proprietà.File di proprietà differenti per lingue diverse consentono la formattazione dinamica basata sullo stesso linguaggio indipendente ma semanticamente contenuto. – mut1na