<html><head><style>a[target] { background-color: yellow;}p[lang] { background-color: salmon;}</style></head><body><h1>[attribute] 选择器实例</h1><p>带有 target 属性的链接会被设置为黄色背景:</p><a href="https://www.w3school.com.cn">W3School</a><br><a href="https://www.google.com" target="_blank">Google</a><br><a href="https://www.microsoft.com" target="_blank">Microsoft</a><p>带有 lang 属性的段落会被设置为橙红色背景:</p><p>Hello world!</p><p lang="no">Hei verden!</p><p lang="it">Salve, mondo!</p></body></html>