CSS to select all rel attributes - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:attribute exist

Description

CSS to select all rel attributes

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div[rel] {<!--from  w w  w .  jav a2 s.  c o m-->
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div rel="asdf">
    Lorem 
  </div> 
  <div>
    Lorem 
  </div> 
  <div rel="af">
    Lorem 
  </div> 
  <div>
    Lorem 
  </div>  
 </body>
</html>

Related Tutorials