Week 11 - Introducing HTML5 Basic Tags and Special Tags
Week 11 - Introducing HTML5 Basic Tags and Special Tags
A markup language is being utilized to create a web page to show the multimedia documents.
The Hypertext Markup language is the standard language used on web for developing
websites which is created by Tim Berners-Lee in 1991.
HTML is the standard markup language for creating Web pages. It describes what a website
looks like. Programmers use HTML tags to design and create websites. HTML 5 is the latest
version of HTML.
HTML documents are text files that contain two parts, the web content and tags.
Content are all that is meant to be displayed on a computer screen, while the Markup or
tags are symbols that tell your browser how to display the text of a web page and is generally
hidden from the user.
Tags should be enclosed in a pair of angle brackets < >. If you want any formatting in your
page, you have to give the browser instruction by using HTML tags.
content
tags
Figure 1: Content and Markup
There are two kinds of tags in HTML.
a. Those that can stand alone in your document: <TAG/>.
b. And the tags that require an opening and a closing tag:
In HTML open tags must be closed to have a valid HTML document or web page.
Some tags don't have text between the opening and closing tag. These are called standalone
tags. They can self-close:
a. <BR/>
Putting a line in between sentences.
b. <HR/>
Inserting a horizontal line in your page.
If you have multiple open tags you must close them in reverse order, to make it more valid
HTML instruction
<HTML>
<BODY>
<TITLE>
</TITLE>
</BODY>
</HTML>
<TAG ATTRIBUTE="value">
It is a good idea to capitalize the attributes, put quotes around the value of the attribute and
type the value of the attribute in lower case.
HTMLS Structure
Every web page requires five critical tags:
a. !DOCTYPE
b. HTML
c. HEAD
d. TITLE
e. BODY
The following is an example of the structure of a web page:
<!DOCTYPE html>
<HTML>
<HEAD>
Head Declarations
<TITLE> Title Declaration </TITLE>
</HEAD>
<BODY>
Body Declarations
</BODY>
</HTML>
As discussed in our previous topic, the purpose of any web browser is to read and display
the content of an HTML document. Browsers do not display HTML tags, and HTML utilize
these tags to determine how the document will be displayed.
<HEAD>
<TITLE> My First Web Page </TITLE>
</HEAD>
<BODY>
</BODY>
•
<HEAD>
<TITLE> My First Web Page </ TITLE>
</ HEAD>
<BODY>
welcome to my Page !
</ BODY>
</h or<oL
I
I I
-
17' D My First Web Page jx •
co <D "'' .1 ,,.._,.,
(L:{ YY~w •lte
\\·elcome to my Page!
In creating lists, however, it is important to know that each listed item is accompanied by
an <Ll></Ll> tag.
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE> Unordered list </TITLE>
</HEAD>
<BODY>
list of Colors
<Ul>
<LI> Red </LI>
<LI> Blue </LI>
<LI> Green </ LI>
<LI> Black </LI>
</Ul >
</BODY>
</HTML>
List of Colors
• Red
• Blue
• Green
• Black
List of Colors
• Red
• Blue
• Green
• Black
Unordered List tags use bullet in each item by default, however, you may change its default
setting by using any of the following <UL> "type" attributes: Circle, Disc, or Square.
A sample for the 'circle' attribute is provided below. Try exploring the other attributes by
changing the attribute to any of the remaining attributes.
<!DOCTYPE ht mt>
<HTHL>
<HEAD>
<TITLE> Unordered Lis t </TITLE>
</HEAD>
<BODY>
Lis t of Cotors
<U L type = "ci rcte">
<LI > Red </ LI>
<LI> Btue </LI>
<LI> Green </LI>
<LI> Btack </LI>
</U L>
</BODY>
</HTHL>
List of Colors
o Red
o B lue
o Green
o Black
Ordered List <OL> & </OL>
If it is essential for you to place your item in a numbered list instead of bullets, then you
may use the Ordered List tags <OL> and </OL> respectively at the beginning and end of the
lists.
<! DOCTYPE html>
<HTML>
<HEAD>
<TITLE> Ordered List </TITLE>
</HEAD>
<BODY>
List of Colors
<OL>
<LI> Red </LI>
<LI> Blue </LI>
<LI > Green </LI>
<LI> Black </LI>
</OL>
</BODY>
</HTML>
The above code will display the output below:
L ist of C o lo rs
1. R ed
~ - Blue
3 . Green
4 . B lack
The above code which uses the OL type="A" will display the result below:
ltst of Co!Of'l
ARtd
BB~
C Green
D Black
Anomer Lm of Co!Ofi
E. \\lute
F Orange
G \!olet
I! Gray
Lesson 3: HTML Tags for Images and Hyperlinks
HTML Images
A webpage or website may also display images. An HTML file can support 3 basic image file
formats: JPG (jpeg), GlF, and PNG.
HTML uses the <IMG> tag to insert image into your website. In using the <IMG> tag, it is
important to know that this is a self-closing tag. This means that this tag does not require an
end tag.
The <IMG> tag has the following attributes:
src- a relative path or URL to where the image file is located.
alt - an alternative text which describes the image. It is useful (but optional) to always
include the alt attribute inside the <IMG> tag. The alternate text will be displayed instead of
the image if the browser cannot read or load the image file.
width - use this attribute to change the width of an image. The width value can be changed
using two different units: pixels (px) or through the percentage (%) of the screen's actual
•
SIZe.
height - use this attribute to change the height of an image. Similar to the width value, the
height value can also be changed using two different units: pixels (px) or through the
percentage(%) ofthe screen's actual size.
<!DOCTYPE html.>
<HTM L>
<H EAD>
<TITLE> Images </TITLE>
</HEAD>
<BODY>
<img src = " AMA_Unive rsity_ l.ogo . png" al.t="AMA Universi ty Logo"/>
</BODY>
</HTML>
<!DOCTYPE htmt>
c:HTML>
<HEAD>
<TITLE> Images </TITLE>
</HEAD>
<BODY>
Act ual image size
<br><br>
<img src ~ "AMA_University_logo . png" att~"AMA University Logo"/>
<br><br>
Image r esized using pe rcentage
<br><br>
<img src ~ "AMA_Un ive rs i ty_logo . png" alt="AMA Unive r sity Logo" width ~ "50%"/>
</BODY>
</HTM L>
UNIVERSITY
Changing image width and height using pixels
< !DDCTYPE html>
<HTML>
<HEAD>
<TITLE> I mages </TITLE>
</HEAD>
<BODY>
Actual image size
<br><br>
<img src a " AMA_University_logo.png" alt5"AMA Unive rsity Logo" />
<br><br>
Image resized us ing Pixel
<br><b r>
<i mg src = "AMA_University_logo . png" alt•"AMA University Logo" width • "290px" height • "12Bpx"/>
</BODY>
</HTML>
UNIVERSITY
Image restZed usmg PL-<el
M~
UNIVERSITY
Adjusting the width and height of a particular image through pixels will most probably make
image distortion while using percentage will enable you to adjust a picture proportionally.
However, it is still important to note that there are some instances wherein pixel-based
image adjustment would still be useful compared to the latter.
HTML Hyperlinks
HTML Links are called Hyperlinks. You can visit one webpage to another through links.
HTML links or hyperlinks are used as a tool to move from one accessible page or section of a
website to another.
HTML links are defined using the anchor tag or <a> tag. The <a> tag has an attribute "href'
which identifies the URL of the web page to be opened once the link is clicked.
HTML sample codes and each sample's corresponding results are provided in the succeeding
pages.
<IDOCTYPE html>
<HTML>
<HEAD>
<TITLE> Links </TITLE>
</HEAD>
<BODY>
Below 1s a link to facebook page .
<br>
<a href = "www. facebook . com">
<img src="fb . png" alt="FB logo" width="50px" height="50px"/>
</a>
</BODY>
</HTML>
3. Rich, J.R. (2017). Working in the Cloud: Using Web-Based Applications and Tools to
Collaborate Online. Indianapolis, Indiana: QUE Publishing