HTML CSS examples for CSS Selector:attribute equals value
Select <a> elements with a target="_blank":
<!DOCTYPE html> <html> <head> <style> a[target=_blank] { background-color: yellow; } </style><!--from w w w . j a v a2s . c om--> </head> <body> <p>The link with target="_blank" 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> <p><b>Note:</b> For [<i>attribute</i>] to work in IE8 and earlier, a DOCTYPE must be declared.</p> </body> </html>