Saturday, February 21, 2009

Xhtml Syntax and Rules

What is a xhtml?

XHTML stands for EXtensible HyperText Markup Language
XHTML is a stricter and cleaner version of HTML
XHTML is a combination of HTML and XML (EXtensible Markup Language).

What is a xhtml?


XML is a markup language where everything has to be marked up correctly, which results in "well-formed" documents.

Why use xhtml?

Today's market consists of different browser technologies, Some are used to run on computers and some are used to run on mobile other small devices. These small devices does not support bad markup . So we need to use xhtml for these technologies.

By combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML.

To make website SEO friendly.

The most important things about Xhtml:

XHTML elements must be properly nested
E.g


This is Bold and Italic

Should be like this

This is Bold and Italic

XHTML elements must always be closed
E.g

must be


XHTML elements must be in lowercase
E.g

Para

Should use like this

Para

XHTML documents must have one root element

All XHTML elements must be nested within the root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is:

What’s the difference between
and
tags?

tags are block elements that allow you to position elements contained within them
tags are NOT block elements They are Inline elements.
tags create line breaks, tags do not

No comments:

Post a Comment