0% found this document useful (0 votes)
4 views3 pages

HTML Tutorial 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

HTML Tutorial 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML LINKS

Links allow users to navigate from page to page in a website.

HTML - Hypertext Reference (href)

A Hypertext Reference (href) is an HTML attribute of an anchor (link) tag that


requires a valid URL in order to properly direct a user to a different location.

To create a hyperlink, you use the a "<a> </a>" tag with the href attribute. The
Hypertext Reference below (in red) is where users will navigate to if they click on the
link "ESPN Home".

e.g. <a href="http://www.espn.com/">ESPN Home</a>

The example above is an external link since it links to an external web address that
does not reside on your domain.
e.g. <a href="aboutus.html">About us</a>

The example above is an internal link. The aboutus.html file is located in the same
folder as the document containing the link.

HTML Images
In HTML, images are defined with the <img> tag.

The <img> tag is empty, which means that it contains attributes only, and has no
closing tag.

To display an image on a page, you need to use the src attribute. Src stands for
"source". The value of the src attribute is the URL of the image you want to display.

Syntax for defining an image:

<img src="url" alt="explanation_text"/>

The URL points to the location where the image is stored. An image named "boat.gif",
located in the "images" directory on "www.bcc.edu.bb" has the URL:
http://www.bcc.edu.bb/images/boat.gif.
The browser displays the image where the <img> tag occurs in the document. If you
put an image tag between two paragraphs, the browser shows the first paragraph, then
the image, and then the second paragraph.

The required alt attribute specifies an alternate text for an image, if the image cannot
be displayed.

The value of the alt attribute is an author-defined text:

<img src="boat.gif" alt="Big Boat"/>

The alt attribute provides alternative information for an image if a user for some
reason cannot view it (because of slow connection, an error in the src attribute, or if
the user uses a screen reader).

The height and width attributes are used to specify the height and width of an image.

The attribute values are specified in pixels by default:

<img src="images/clouds.jpg" alt="Clouds in the sky" width="304" height="228"/>

HTML TABLES

Tables are defined with the <table> tag.

A table is divided into rows (with the <tr> tag), and each row is divided into data cells
(with the <td> tag). td stands for "table data," and holds the content of a data cell. A
<td> tag can contain text, links, images, lists, forms, other tables, etc.

Table Example
<table>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>

How the HTML code above looks in a browser:

row 1, cell 1 row 1, cell 2


row 2, cell 1 row 2, cell 2

HTML Tables and the Border Attribute

If you do not specify a border attribute, the table will be displayed without borders.
Sometimes this can be useful, but most of the time, we want the borders to show.

To display a table with borders, specify the border attribute:

<table border="1">

Cordova Tutorial 1 Table:

<table border=1>
<tr>
<th>STUDENT OPTION</th>
<th>FEES</th>
</tr>
<tr>
<td>Full time:</td>
<td>$1000</td>
</tr>
<tr>
<td>Part time:</td>
<td>$2500</td>
</tr>
</table>

You might also like