CSS attribute-value selector for searching value containing hash # sign - HTML CSS CSS

HTML CSS examples for CSS:Selector

Description

CSS attribute-value selector for searching value containing hash # sign

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[data-demo=works] {
   color:Chartreuse;
}

div[data-demo='#doesnt_works'] {
   color:yellow;
}
</style> <!--  w w w  .j  a  v  a2 s.  c  om-->
 </head> 
 <body> 
  <div data-demo="works">
    Lorem ipsum 
  </div> 
  <br> 
  <div data-demo="#doesnt_works">
    Lorem ipsum 
  </div>  
 </body>
</html>

Related Tutorials