get CSS to select ID of specific pattern - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:id

Description

get CSS to select ID of specific pattern

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">
[id^=q]:not(#qrst) {
   color:Chartreuse;
}
</style> <!--from w  w w . ja va  2s . c  o  m-->
 </head> 
 <body> 
  <div id="q1q4">
    Lorem 
  </div> 
  <div id="q2q4">
    Lorem 
  </div> 
  <div id="q1q5">
    Lorem 
  </div> 
  <div id="qrst">
    Lorem 
  </div>  
 </body>
</html>

Related Tutorials