Professional Documents
Culture Documents
Lab 09:
Introduction to HTML Basic Tags
Attributes, Images, Links, Font, Background Color, Listing & Tables
Objective:
Terms to know before starting HTML
Internet
Web page
Websites
Web browser
Web server
Internet
The Internet is a global network connecting millions of
computers.
Web page
A file usually written in HTML that can be read by a Web
Browser
Websites
A Website is a collection of linked documents known as
webpages.
The main page in a website is called a homepage, and other
pages in a website are called subpages.
These are connected by hyperlinks.
Web browser
Browsers are basically software programs that allow you to
Search for and view various kinds of information on the
Web, Such as web sites, video, audio, etc.
<head>
<title> Learning HTML </title> // Title of web page
</head>
Creating paragraphs
A blank line always separates paragraphs in textual materials.
The tag that provides this functionality is <p> tag.
On encountering this tag, the browser, moves onto a new line, skipping one line between the
previous line & the new line.
Example #01
Example # 02
Html comment
The comment tag is used to insert comments in the source code. Comments are not displayed in the
browsers.
Example # 03
Attributes of tags
Attributes are the properties of tag.
Attributes give certain characteristics to a tag (e.g., height, width, color, etc)
Attributes are always specified in the start tag.
Attribute values should always be enclosed in quotes.
For example “align” is an attribute. Its possible values are: right, left, center and justify.
HTML Attributes:
In html there are much more attributes which are used for different purpose but at this stage we
discus four which are given bellow:
title
href
size
Example 05:
Example 06:
Size Attributes
HTML images are defined with the <img> tag.
The filename of the source (src), and the size of the image (width and height) are all provided as
attributes:
The average page width is 960 pixels and average page height is 1024 pixels.
Example 07:
Note: A pixel is generally thought of as the smallest single component of a digital image.
Note: The number of pixels in an image is called resolution.
The image size is specified in pixels: width="104" means 104 screen pixels wide.
HTML Images
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:
HTML Links
Links are found in nearly all web pages. Links allow users to click their way from page to page.
Note: A link does not have to be text. It can be an image or any other HTML element.
The href attribute specifies the destination address (http://www.dsu.edu.pk/) of the link.
Clicking on the link text will send you to the specified address.
Example 9:
Tables in HTML
<TABLE>
<TR> Table Row
<TH> Table Heading
<TD> Table Data
TD And TR
We divide row into columns by placing the <TD> and </TD> tags between <TR> and </TR>
We enter the row's cell data by typing text between each <TD> and </TD>
AHMED 99 87 76
ALI 95 65 90
MS-WORD
THEORY PRACTICA
98 94