HTML Links

A link is the “address” to a document (or a resource) located on the World Wide
Web or elsewhere within your own Web server.

HTML Links – Syntax

In HTML, links are defined with the <a> tag:

Link Syntax:
<a href=”url”>link text</a>

Open a Link in a New Browser Window
The target attribute enables you to control how the browser responds when you click on the link. The following example demonstrates how to link to another page by opening a new window so that the visitor does not have to leave your Web site.

Lets see an Example

<html>
<body>
<a href=”lastpage.htm” target=”_blank”>Last Page</a>
<p>
If you set the target attribute of a link to “_blank”,
the link will open in a new window.
</p>
</body>
</html>

HTML Tables

Tables are an excellent way to organize and display information on a page. Tables are defined using the <table> tag.A table is divided into rows with the <tr> tag, and each row is divided into data cells using the <td> tag. The letters td stand for “table data,” which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, and so on.

Lets see an Example

<html>
<body>
<table border=”1″>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
</body>
</html>

7

HTML Lists

Unordered HTML Lists

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles).

Lets see an Example

<!DOCTYPE html>
<html>
<body>

<h2>Unordered List with Default Bullets</h2>

<ul style=”list-style-type:disc”>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>

</body>
</html>

8

Unordered HTML Lists – The Style Attribute

9

Ordered HTML Lists

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

Lets see an Example

<!DOCTYPE html>
<html>
<body>

<h2>Ordered List with Numbers</h2>

<ol type=”1″>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>

</body>
</html>

10

Ordered HTML Lists – The Type Attribute

11

Leave a Reply