basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference



The Document Tree

A web page or document written in X(HTML) is made up by a series of elements which follow each other in the page code. This sequence of elements is referred to as the Document Tree and the way the different elements which make up the document tree relate to each other is an important concept to understand.

The position of an element compared to the other elements in the document is defined by a series of relationships which are explained here using the following simple document tree for illustration purposes:

<html>
<head>
<title>......</title>
</head>
<body>
<p>.....</p>
<ul>
<li>......</li>
<li>......</li>
<li>......</li>
</ul>
<p>.....</p>
</body>
</html>

It is especially important to have a firm grasp of the document tree in relation to CSS selectors, many of which are applied to elements according to their relationship to other elements in the document tree - such as children, siblings and descendants. In addition to this the use of the CSS position, top, right, bottom and left properties can depend on element relationships within the document tree.