css select target

by Daniel Beff

HTML

<div class = "richtext richtext-default">
  <p> 
  <strong> This is text </strong> 
  </p> 
  <p> 
    <a href="http://google.com" target="aaa"> 
    Learn more 
   </a>  
   FilmographyFilmographyFilmography
   <a href="http://url1.com" target="_blank">
     blablabla </a>
   </ p> 
</ div> 



<div class = "richtext richtext-default"> 
  <p> 
    <strong> This is text </strong> 
  </p> 
  <p> 
    <a href = "http://google.com" target = "aaa">
    Learn more 
    </a> 
  </p> 
  <p> 
    <a href="http://url2.com" target="_blank" class="is-external"> Display as a button </a> 
  </p>
</div>

CSS

/* select with one parameters */
*[target="_blank"] {
  color: red;
}
/* select with two or more parameters */
a.is-external[target="_blank"][href="http://url2.com"] {
  background: orange;
  color: white;
  border-radius: 3px;
  padding: 10px 20px;
  text-decoration: none;
}
/* select using a element */
a[target="aaa"]{
  color: green;
}