Home
CSS
CSS Attr Selectors
Tryit: The [attribute~="value"] selector
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> [title~="flower"] { border: 5px solid yellow; } </style> </head> <body> <h2>CSS [attribute~="value"] Selector</h2> <p>All images with the title attribute containing the word "flower" get a yellow border.</p> <img src="klematis.jpg" title="klematis flower" width="150" height="113"> <img src="img_flwr.gif" title="flower" width="224" height="162"> <img src="img_tree.gif" title="tree" width="200" height="358"> </body> </html>