专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> <style> [title~=hello] { color:blue; } </style> </head> <body> <h2>将适用:</h2> <h1 title="hello world">Hello world</h1> <p title="student hello">Hello CSS students!</p> <hr> <h2>将不适用:</h2> <p title="student">Hi CSS students!</p> </body> </html>
运行结果