HTML CSS examples for CSS:Selector
Selectors by attribute name
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> [data-name] {<!--from w w w . j av a2 s . co m--> background-color:Chartreuse; } [data-name] [data-someAttribute] { background-color:yellow; text-decoration:underline; } </style> </head> <body> <div data-name="something"> <p>Lorem ipsum dolor sit </p> <span data-someattribute="someAttribute">Lorem ipsum dolor sit amet, con</span> </div> </body> </html>