CSS 参考手册
CSS [attribute|=value] 选择器
选择一个lang属性的起始值="en"的所有元素
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <style> [lang|=en] { background: yellow; } </style> </head> <body> <p lang="en">Hello!</p> <p lang="en-us">Hi!</p> <p lang="en-gb">Ello!</p> <p lang="us">Hi!</p> <p lang="no">Hei!</p> <p><b>Note:</b> For [<i>attribute</i>|=<i>value</i>] to work in IE8 and earlier, a DOCTYPE must be declared.</p> </body> </html>
运行结果:
点击运行 »