Basic HTML Tags - Four Examples

This chapter demonstrates the most commonly used HTML tags through examples.

Tip:Don't worry about the examples you haven't learned in this chapter; you will learn them in the following chapters.

Tip:The best way to learn HTML is to learn by doing experiments. We have prepared a good HTML editor for you. With this editor, you can edit a piece of HTML source code freely, and then click the TIY button to view the results.

HTML Titles

HTML headings (Headings) are defined by the <h1> - <h6> tags.

Example

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

Try It Yourself

HTML Paragraphs

HTML paragraphs are defined by the <p> tag.

Example

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Try It Yourself

HTML Links

HTML links are defined by the <a> tag.

Example

<a href="http://www.codew3c.com">This is a link</a>

Try It Yourself

Note:Specify the link address in the href attribute.

(You will learn more about attributes in the later chapters of this tutorial).

HTML Images

HTML images are defined by the <img> tag.

Example

<img src="codew3c.jpg" width="104" height="142" />

Try It Yourself

Note:The name and size of the image are provided in the form of attributes.