Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
CSS style based on tag content
Hello everybody! Is it possible to do different for example text colours dependent on whatās tag contains? I mean If tag <a> contains(text) āloginā it is red coloured But if <a> contains(text) ālogoutā it is blue coloured Text inside āā is just text, not classes, ids. Please do not show me JavaScript examples, I want to handle this by just css, best regards, Eterxoz
5 Respostas
+ 1
Just add id atrributes of login and logout, set the css selectors accordingly.
+ 1
Eterxoz I know that you look for css to check for text content, unfortunately it's not possible for css to check for text node now.
0
CalviÕ² Thanks for help, but as i mentioned i want different styles based on content, not id/classes.
0
Eterxoz for your study, using JavaScript is another option.
https://code.sololearn.com/Wc6q6gha2q4L/?ref=app
0
CalviÕ² I know javascript is an another option. Just wondering if it is possible with just css. I found something like ācontainsā pseudoclass, but in documentations it is not explained in any proper way. Just an space with āto be filledā is left. Anyway thanks for help!
for others: It is not possible yet(06.01.2019).
best regards,
Eterxoz