June 13, 2010

XHTML codes

by Karine in Beginner with no response

We have seen how to create a basic webpage. Now we want to add some content to it. Here is a list of the most common tags and how they're used.

Headings

<h1>, <h2>, <h3>, <h4>, <h5>, <h6> : they define your webpage headings. h1 is the most important, usually your website title if on the homepage, and the page title if on a specific page (for example, the blog post title).

Usage:

<h1>Hello World</h1>

Text

<p> : this creates a paragraph.

Usage:

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>

<br /> : inserts a line break where you place it.

Usage:

<br />

<strong>, <b> : bold

Usage:

<strong>Bold text</strong>
<b>Bold text</b>

<em>, <i> : italic

Usage:

<em>Italic</em>
<i>Italic</i>

Link

<a> : inserts a link or an anchor

Usage:

<a href="URL" title="Description">The link text</a>

Image

<img> : inserts an image where you put it

Usage:

<img src="image-url.jpg" alt="Alternative text" width="value" height="value" />

Lists

<ul> and <li>

Usage:

<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>

<ol> and <li>

Usage:

<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>

Forms

<form> : defines a form

Usage:

<form action="script url" method="get">
...
</form>

<label> : form element description

Usage:

<label>Name:</label>

<input> : inserts a form field, can be text, checkbox, file, etc.

Usage:

<input type="type" name="name" value="value" />

<textarea> : inserts a textarea (multiple lines)

Usage:

<textarea name="name" cols="value" row="value">value</textarea>

There is a lot more, read W3Schools HTML 4.01/XHTML 1.0 Reference for more !

Tags

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

↑ Back to Top