HTML CSS examples for CSS Selector:attribute contains word
The [attribute~=value] selector selects elements whose attribute value contains the specified word.
Select elements with a title attribute containing the word "test":
<!DOCTYPE html> <html> <head> <style> [title~=test] {<!--from w ww . j a va 2s . c o m--> border: 5px solid red; } </style> </head> <body> <img src="https://www.java2s.com/style/demo/Opera.png" title="test case" width="150" height="113"> <img src="https://www.java2s.com/style/demo/Firefox.png" title="tests" width="224" height="162"> <img src="https://www.java2s.com/style/demo/Opera.png" title="this is a test" width="160" height="120"> </body> </html>