Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

XHTML Indentation Tutorial

Share this post!
 Vote this!

There are many techniques that are useful to any kind of programming language. Although XHTML is not technically a programming languages (it is what we call a markup language, a language that doesn't control flow or activity, but rather that simply adds description to existing text), some of the same techniques apply to it, as well.

Possibly the most important programming technique is indentation. In a regular piece of text, indentation is generally used to indicate the beginning of a new paragraph. When quoting large amounts of text, that text is indented in what is commonly referred to as a `block quote'. These are all stylistic devices to help us read the text more easily -- they set apart certain parts of the text so that we might notice them more.

 In the case of block quotes, it helps to clearly set apart that which is not one's own work when it is too long to simply put in quotation marks (how long depends on the writing style you are using). In the case of paragraph differences, it helps emphasize the logical divisions in the text with stylistic ones. This latter usage is the reason that code is indented.

Indentation is critical to easy-to-read code. XHTML in particular has the characteristic that it is a structural language -- it describes the structure of a document. Now, XHTML describes the structure of a document for a browser. Theoretically speaking, it also describes it for a human being reading the code; however, since human beings do not read, parse, and process XHTML with the ease that a browser can do it, we need additional aids. That is what indentation is for XHTML --

More...

0 comments:

Post a Comment