Use quote marks to find an "exact phrase"

Print version

print icon

7: Child and descendant elements

Child and descendant elements

A child element is an element within another element. The other element is the 'parent' element.

If a child element has an element within it, then the latter is a 'descendant'. This more general term can refer to an element of any generation below the parent, including a child element. Other 'related' terms may also be seen, such as 'ancestors'.

An example of a parent/child relationship is when there is a 'div' within another 'div', as shown below:

<div>			(parent element)
 <div>			(child element)					
 </div>			(close child element)
</div>			(close parent element)