(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{575:function(t,e,s){"use strict";s.r(e);var a=s(56),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"more-css-selectors-descendents-and-siblings"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#more-css-selectors-descendents-and-siblings"}},[t._v("#")]),t._v(" More CSS Selectors: Descendents and Siblings")]),t._v(" "),s("p",[t._v("In this lecture we're going to explore some more complex CSS selectors for targeting descendent and sibling elements.")]),t._v(" "),s("p",[t._v("Before we start, a quick word on terminology.")]),t._v(" "),s("p",[s("em",[t._v("Descendent elements")]),t._v(" are any elements which are part of the content of another element (known as the "),s("em",[t._v("ancestor")]),t._v("). They need not be direct children of the element in question.")]),t._v(" "),s("p",[s("em",[t._v("Siblings elements")]),t._v(" are any elements which share a parent element.")]),t._v(" "),s("h2",{attrs:{id:"the-descendent-combinator"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#the-descendent-combinator"}},[t._v("#")]),t._v(" The Descendent Combinator")]),t._v(" "),s("p",[t._v("The descendent combinator is a means of combining two or more selectors to describe an ancestral relationship. We achieve this by placing one or more spaces between the selectors.")]),t._v(" "),s("div",{staticClass:"language-css extra-class"},[s("pre",{pre:!0,attrs:{class:"language-css"}},[s("code",[s("span",{pre:!0,attrs:{class:"token selector"}},[t._v("ul li")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("color")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" blue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The result is a descendent selector, that will target any "),s("code",[t._v("
  • ")]),t._v(" element which is a descendent — but, not necessarily a direct child — of a "),s("code",[t._v("