child selectors
Selects all the
p
elements that have
div
element as a parent of any level
div p { 
    color: red; 
}
Selects all the
p
elements that are children of the element with id
#id1
#id1 p { 
    color: green; 
}
Selects all
p
elements that have parent element with class
.class1
.class1 p { 
    color: yellow; 
}
by Valeri Tandilashvili
5 years ago
CSS
selectors
HTML5 and CSS3 beginners tutorials
1
Pro tip: use ```triple backticks around text``` to write in code fences