Indentation and Whitespce


Can someone give me a brief about indentation, whitespace, tags and element.
Thank you


In HTML whitespace is ignored (for the most part) so has no real meaning or affect on the rendering.


The line breaks act as a space character.

Indentation is used by many developers to help with reading and recognizing the structure of the document. A well formed HTML document will follow an outline of sorts with heirarchical headings, sections that are topical and closely related to the headings, and so on.

HTML consists mainly of a lot of containers, and in many instances there will be containers inside containers inside containers. This is known as nesting and where indentation proves very helpful to indicate the level of nesting for a given element.

    <p>textual content</p>
      <li>list item 1</li>
      <li>list item 2</li>
      <li>list item 3</li>
      <li>list item 4</li>

Bottom line, neatness and legibility matter to the reader, even if it matters not to HTML.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.