dylanmcleod
8/26/2015 - 9:26 AM

Advanced CSS Selectors - http://www.smashingmagazine.com/2009/08/taming-advanced-css-selectors/ http://code.tutsplus.com/tutorials/the-30-cs

/* The star symbol will target every single element on the page. */

* {
 margin: 0;
 padding: 0;
}

/* This will target every single element that is a child of the #container div. */

#container * {
 border: 1px solid black;
}

/*This is referred to as an adjacent selector.
It will select only the element that is immediately preceded by the former element.
In this case, only the first paragraph after each ul will have red text.*/

ul + p {
   color: red;
}

/* A selector of #container > ul will only target the uls which are direct
children of the div with an id of container */

div#container > ul {
  border: 1px solid black;
}