<!DOCTYPE html> <html> <head> <style> [title~=flower] { border: 5px solid yellow; } </style> </head> <body> <h1>CSS [attribute~="value"] 选择器</h1> <p>title 属性包含 "flower" 的所有图像会有黄色边框。</p> <img src="/static/demo/images/klematis.jpg" title="klematis flower" width="150" height="113"> <img src="/static/demo/images/flower.gif" title="flower" width="224" height="162"> <img src="/static/demo/images/tree.png" title="tree" width="200" height="358"> </body> </html>