/*choose an element based on
whether it has an attribute.
in this case, we'll choose any
images with title attributes*/

img[title] {
  border: 5px solid red;
}

/*choose an element based on
the value of the attribute.
Let's go for all submit buttons
on forms*/

input[type="submit"] {
  color: white;
  background: blue;
}

/*choose an element based on
what the attribute value starts
with. In this example, grab
any links that start with "http://"
(usually links external to a site)*/

a[href|="http://"] {
  color: red;
  font-weight: bold;
}

/*choose an element based on a
substring of the attrbute's value.
In this one, let's go for links with
the substring ".com" in them*/

a[href~=".com"] {
  color: green;
}