0
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 Answers
+ 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