Module 2
Module 2
HYPERLINK, TABLE
Adding image
• In HTML, images are defined with the <img> tag.
• The <img> tag is empty, it contains attributes only, and does
not have a closing tag.
• The src attribute specifies the URL (web address) of the image:
2
The alt Attribute
3
Image Size - Width and Height
4
Images in Another Folder
EXAMPLE:
<img src=“/images/html5.gif” alt=“HTML5 Icon” width=“128” height=“128”
5
Images on Another Server
6
Add a background image
7
What is hyperlink?
• a link from a hypertext document to
another location, activated by clicking on a
highlighted word or image.
8
Reason for links
Hyperlinks are the backbone of web pages. It
wouldn't be a web page without a hyperlink -
otherwise, it's just like the pages of a term
paper - flat and non-interactive. That
interactivity is paramount, but it can be abused
in a content-based web site if it is not
something that:
(1)leads your audience to more information and
(2)allows your audience to move around your web
site freely exploring the information provided.
9
Types of links
• There are two kinds of hyperlinks : external and internal.
– Internal hyperlinks or "bookmarks" let your audience move
within the web page that is visible. This is important if the web
page is lengthy. For example, the Text: How to Do It web page
of this web site is very long; however, there are bookmarks at
the top of the page that link to sections with in the page.
Although this may not be the best design ever created, it does
serve its purpose. When considering whether to put
everything on the same page in such a lengthy manner, place
yourself in your audience's shoes. Do you want it all on the
same page or would you find it easier to comprehend on
separate pages? Your answer depends on a few factors like
the subject-matter itself and personal preference.
10
Types of links
• External hyperlinks link your web page to
other pages within your web site or to web
pages other people have created. Moving
from page to page within your web site is.
It gives your audience freedom and
choice. Linking outside your web site can
give your audience additional information
related to your web site's content.
11
Link to another web page – External Link
13
Tables
In this chapter you will learn that tables have many
uses in
HTML.
• Objectives:
Upon completing this section, you should be
able to:
- Insert a table.
- Explain a table’s attributes.
- Edit a table.
- Add a table header.
14
Using the <table>,
<tr>, and <td> Tags
15
The General Table Syntax
<table>
<tr>
<td> First Cell </td>
<td> Second Cell </td>
</tr>
<tr>
<td> Third Cell </td>
<td> Fourth Cell </td>
two</tr>
rows
</table>
two
16 columns
HTML Structure of a Table
beginning of
the table
structure
table cells
table
eadings
19
Adding a Table Border
• By default, browsers display tables without table
borders.
• A table border can be added using the border
attribute to the <table> tag.
• The syntax for creating a table border is: <table
border=“value”>
– value is the width of the border in pixels
• The size attribute is optional; if you don’t
specify a size, the browser creates a table
border 1 pixel wide.
20
Tables with Different Borders Values
This figure shows the effect on a table’s border when the border
size is varied.
21
Adding a 5-Pixel Border to a Table
22
Thank you