This question already has an answer here:
I have the following selector:
.post-link[title~=Corporate]
Now I need, instead, to select only elements whose title have the word "Corporate" only at the very beginning, not somewhere else in the title.
So I have two alternatives:
1) create a selector that only checkes at the very beginning of the title and then skip others eventually following or
2) create a selector which can contain a space plus a '|' like:
.post-link[title~=Corporate |]
because in my case all titles begin with
"Keyword |"
(Corporate | i.g.)
But the css is not working any more when I use:
.post-link[title~=Corporate |]
I also tried:
.post-link[title~=Corporate |]
Does not work. How to do this? I cannot find answers with Google.
Thanks a lot!
This should do it.
.post-link[title|="Corporate "]
The
|=
operator matches beginning.You can use
[title^='Corporate']
:Reference: