Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Web Quality - Important HTML Elements

Web Quality - Important HTML Elements


To improve web quality, , and <h1> are both important tags.</p> <hr /> <h2><!DOCTYPE> element</h2> <p>All HTML and XHTML pages should use the <Doctype> element to specify which HTML version they conform to.</p> <p>The doctype defines which HTML version you are using and gives the browser important information so it can render your page faster and more consistently.</p> <p>The document type declaration also lets validation software check the syntax of a page:</p> <h3>HTML 5</h3> <pre><code><!DOCTYPE html> </code></pre> <h3>HTML 4.01 Strict, Transitional, Frameset</h3> <pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> </code></pre> <h3>XHTML 1.0 Strict, Transitional, Frameset</h3> <pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> </code></pre> <h3>XHTML 1.1</h3> <pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> </code></pre> <hr /> <h2><title> element</h2> <title> element is one of the most important HTML elements. Its main function is to describe the content of a web page. <p>Even though the title is not a visible part of the web page, it is still important for improving site quality, because it is visible in the following places:</p> <ul> <li>Search engine listings</li> <li>The window title bar</li> <li>The user's bookmarks</li> </ul> <p>Titles should be as short as possible and descriptive.</p> <p>When a user searches for sites on the internet, most search engines display the site title in their results. Make sure the title matches the page content. That way users are more likely to visit your site by clicking those links.</p> <p>When a user visits your site, the title is visible in the window title bar. Make sure the title still describes the site content even when the window is minimized.</p> <p>After a user visits your site, the page title is stored in the history folder (the user may even bookmark the page). To make later visits successful, make sure the title clearly describes your site.</p> <p><strong>A good title:</strong></p> <h2>Example</h2> <title> <p>HTML Tutorial</p> <p>XML Introduction</p>

Bad heading example::

Example

<p>Introduction</p> <p>Chapter 1</p>

Runoob Tutorial has a complete set of well-organized, easy-to-understand tutorials on HTML, CSS, JavaScript, DHTML, XML, XHTML, WAP, ASP and SQL, with many examples and source code.


Element

The element describes the top-level heading of a web page.

Since some browsers display the

element in a very large font by default, some web developers use the

element instead of the

element to show top-level headings. This does not affect readers, but confuses search engines and other software trying to "understand the page structure".

Make sure to use

for the top-level heading,

and

and for lower levels.

You can try to structure your page according to this template:

This is the main heading

Some initial text

This is a level 2 heading

This is some text. This is some text. This is some text.

This is a level 3 heading

This is some text. This is some text. This is some text.

This is a level 3 heading

This is some text. This is some text. This is some text.

If you do not like the default heading font size, use styles or a style sheet to change it.