|This article may require more external links, but within the Wikipedia's content policies.
Please improve this article by adding appropriate external links. Please remove this tag when this is done. (talk)</td>
Proper HTML markup language requires that all elements describe the type of data contained within. For example, in HTML and XHTML, a
Differences and default behaviourEditar
When they are labelled with
There are three main reasons to use
Styling with CSSEditar
Perhaps the most common use of
For these reasons, and for compatibility with the concepts of the semantic web, discussed below, attributes attached to elements within any HTML should describe their semantic purpose, rather than merely their intended display properties in one particular medium. For example,
This kind of grouping and labelling of parts of the page content might be introduced purely to make the page more semantically meaningful in general terms. It is impossible to say how and in what ways the World Wide Web will develop in years and decades to come. Web pages designed today may still be in use when information systems that we cannot yet imagine are trawling, processing and classifying the web. Even today's search engines such as Google and others are using proprietary information processing algorithms of considerable complexity.
The World Wide Web Consortium (W3C) has for some years been running a major Semantic Web project designed to make the whole web increasingly useful and meaningful to today's and the future's information systems.
During the page design process, the designer has a clear idea of exactly the purpose and meaning of each element and sub-element of the content. If possible, and if standard HTML elements exist that express that meaning, they should be used. If not, there is no better time to encapsulate the meaning and purpose in a
The Microformats movement is an attempt to build on this idea of semantic
Access from codeEditar
Once the HTML or XHTML markup is delivered to a page-visitor's client browser, there is a chance that client-side code will need to navigate the internal structure (or Document Object Model) of the web page.
Less common, but just as important examples of code gaining access to final web pages, and having to use
The judicious use of
For example, when structurally and semantically a series of items need an outer, containing element and then further containers for each item, then there are various list structures available in HTML, one of which may be preferable to a homemade mixture of
For example, this...
<ul class="menu"> <li>Main page</li> <li>Contents</li> <li>Help</li> </ul>
...is usually preferable to this:
<div class="menu"> <span>Main page</span> <span>Contents</span> <span>Help</span> </div>
Other examples of the semantic use of HTML rather than