Indiana University
School of Library and Information Science
Information Design for the Web

The tree structure of HTML documents

HTML elements can be:

Block level

These elements begin and end lines (they use line breaks)

<div> <ol> <blockquote>

Inline

These elements affect page content within a line

<span> <a href> <b>

Invisible

These elements are not displayed on the screen

<style> <title> <meta>

Trees develop as you nest these element in your page markup

This important for the way that stylesheets work because of inheritance and cascading

HTML document tree

Basics: How CSS work

A style sheet is a document that contains rules that instruct a browser to render a page in a certain way

The rules of a style sheet are listed in one of three ways:

Gathered together in a separate, non-HTML document with the extension .css

Here's an example - this is the style sheet used for these demonstration pages (this link opens a new window. Close it to return to this page)

Gathered together in the <head> of the content document

Used individually in the <body> of the content document

Stylesheet rules affect a document when the browser applies them to the tree structure of the document

The way the rules are "inherited" is determined by two factors

Inheritance: the "parent-child" relationship among page elements

The cascade: the placement of the rules and the order of the style elements

Next!

You are here: http://memex.lib.indiana.edu/hrosenba/www/Workshops/CSS/Demo/cssbasics2.html
Last updated 3.15.06 - H. Rosenbaum