css parent child class selector code example

Example 1: css parent selector

/* There is no such selector
   in 2008, the following was suggested */

a < img { 'border': none }

/* Which in theory, would set an an images 'a' parent
   border to none
   Of course, this does not exist

   Another suggestion... */

div:parent { 'border': none }

/* Pretty self explainatory, nevertheless it does not
   exist.

   You will have to use JavaScript/jQuery */

$('some-element').parent();

Example 2: css immediate child

.parent>.immediate-child {
  color: red;
}

Example 3: how to use child selectors in css

ul li { margin: 0 0 5px 0; }
ul > li { margin: 0 0 5px 0; }