Chap 01b - Intro To HTML
Chap 01b - Intro To HTML
Introduction to HTML
Prepared for:
CSC264 – Introduction to Web and Mobile
Application
OVERVIEW OF THIS CHAPTER
Dreamweaver
2. Web Browser:
To test your HTML tags
HTML VERSIONS
HTML Versions:
Since the early days of the web, there have been many versions
of HTML:
To display a document correctly, the browser Version Year
must know the version of HTML used
HTML 1991
To do this, you need to HTML 2.0 1995
declare the HTML
document HTML 3.2 1997
HTML 4.01 1999
Syntax used:
< !DOCTYPE > XHTML 2000
HTML5 2014
HTML5:
HTML
4.01:
XHT
HTML TAGS
HTML Tags:
Are keywords (tag names) surrounded by angle brackets < >
The tag names tell the browser how to display the content
Some HTML
Br- Break line
elements can
Hl – horizontal line
have attributes
HTML PAGE STRUCTURE
HTML Page Structure:
All normal web pages consist of:
1. Head:
Is used for text and tags that do not show directly on the
web page
2. Body:
Is used for text and tags that are shown directly on the
web page
content
HTML PAGE STRUCTURE: HEAD
The Document Head:
The HTML element for a document head
is:
<head> content </head>
Inside it, you can put any information regarding your web page such as:
1. Title of your web page:
It is shown at the top of your browser window when the page is
loaded
HTML PAGE STRUCTURE: HEAD
Will create a space between any text or images preceding the enclosed text
Creates a
space
HTML STRUCTURE: BODY
Line Break Tag:
The syntax for line break tag (NO end
tag):
<br> content
Will end
the current
line AND
bring the text
after it onto
the next
line
HTML STRUCTURE: BODY
Horizontal Tag:
The syntax for horizontal tag (NO end
tag):
<hr> content
</html>
HTML ATTRIBUTES
HTML Attributes:
Some HTML elements can have attributes
It provides additional information about an element
Are always specified in the start tag
Has the following syntax:
attributename = “value”
start tag
Attribut value
e
EXAMPLE
style = “property:value;”
Property Purpose
background-color Used for background colour
color Used for text colour
font-family Used for text fonts
font-size Used for text sizes
text-align Used for text alignment
HTML ATTRIBUTES
Can also be
left or right
HTML ATTRIBUTES
Style Attribute
(CSS):
HTML COMMENTS
HTML Comments:
Are text that will be ignored and not displayed by the
browser
A comment has the following syntax:
<!-- comment -->
For
example
:
HTML DATE AND TIME
HTML Date and Time:
Uses the <time> element in HTML:
Represents a machine-readable date,time,or duration
Useful for creating event scheduling, archiving,and other time-based
functions
HTML DATE AND TIME
HTML Date and Time:
For example:
<time> element
datetime attribute
HTML DATE AND TIME
HTML Date and Time:
The time element and datetime attribute have the following
syntax:
<time datetime = "YYYY-MM-DD hh:mm:ss TZD”>
HTML DATE AND TIME
HTML Date and Time:
The datetime attribute can be used for the following
formats:
HTML LENGTHS
HTML Lengths:
To specify length values for attributes, you can
use:
1. Pixels:
Represents the number of pixels
Used especially for setting up images
and tables
HTML LENGTHS
HTML Lengths:
To specify length values for attributes, you can use:
2. Percentage:
Represents the percentage of the total length of the
available space
HTML CHARACTER REFERENCES
For example:
< represents the sign <
> represents the sign >
© represents the copyright symbol ©
EXAM QUESTION EXAMPLES
Exam: CSC318,
January 2018
33
EXAM QUESTION EXAMPLES
Exam: CSC318, June
2018
34
EXAM QUESTION EXAMPLES
Exam: CSC318,
December 2018
35