HTML CSS examples for CSS Selector:attribute exist
The [attribute] selector selects elements with the specified attribute.
Style all <a> elements with a target attribute:
<!DOCTYPE html> <html> <head> <style> a[target] {<!--from w ww. j a va2 s.c o m--> background-color: yellow; } </style> </head> <body> <p>The links with a target attribute gets a yellow background:</p> <a href="https://www.java2s.com">java2s.com</a> <a href="http://www.google.com" target="_blank">google.com</a> <a href="http://www.wikipedia.org" target="_top">wikipedia.org</a> </body> </html>