Hypertext Markup Language (HTML) : Structure of HTML Documents
Hypertext Markup Language (HTML) : Structure of HTML Documents
Hypertext Markup Language (HTML) : Structure of HTML Documents
Claudine Narciso
HTML Scripting Language
The original HTML was design by Tim Berners-Lee, who is aided by his colleagues at CERN, which is an international
scientific organization that is based in Switzerland.
HTML documents are plain text files (that are not case sensitive) which can be created using text editors.
• Elements
Elements are the primary components of an HTML file. These include the tables, paragraphs, lists, etc.
• Tags
A tag represents the various elements of the HTML document. It provides instructions on how the
information will be processed and displayed by the browser. It consist of an element name (or letter symbol)
enclosed in a left and right angle brackets.
Kinds of Tags
o Paired Tags
Paired tag consists of a start tag and end tag. The start tag marks the beginning of a section that is
indicated by the left angle bracket, an element name (or letter symbol) and a right angle bracket. On the
other hand, end tag marks the end of a section and looks exactly as the start tag with a forward slash
before the element name or symbol.
Majority of the HTML Tags are paired. Examples are <HTML></HTML> and <P></P>.
o Empty Tags
Empty tags are tags that do not require and end tag. Examples are <BR> and <HR>.
• Element Attributes
Attributes are additional information used to modify and enhance an element and are always place within
the start tag of an element, after the elements name or symbol.
Several attributes can be associated with an element and are separated with each other by space.
The value(s) assigned to an attribute may be enclosed either in single quotes or double quotes. Several
values separated by comma can be assigned to a specific attribute.
The structure of the HTML document follows the “first in, last out” rule, which means that the first tag used in the
document should also be the last tag to be closed in the document.
Basic Tags
The basic structure for all HTML documents should include the following minimum elements or tags.
➢ <html> - the main container of html pages
➢ <head> - the container of page for header information
➢ <title> - the title of the page
➢ <body> - the main body of the page
Web Prog & Dev 2
Claudine Narciso
HTML TAGS
Page Structure and Description Tags
<HTML></HTML>
<HTML> tag is used to indicate that the document is an HTML file. It indicates the beginning and the end of the HTML file.
<HEAD></HEAD>
The <head> tag delimits the header section of the document and contains information about the document that is not
generally displayed in the document. Several head elements such as LINK, META, TITLE, SCRIPT, BASE and STYLE can be
placed within the document head for extensible specification of the metadata.
<BODY></BODY>
<body> tag sets the overall page characteristics and delimits the beginning and end of the body section of the HTML
document. It contains the entire document to be displayed on the page.
Attributes of the <body> tag:
✓ BACKGROUND
✓ BGCOLOR
✓ BGPROPERTIES
✓ ALINK
✓ LINK
✓ VLINK
✓ TEXT
Attributes
1. Class or id
2. Name
3. Title
4. Style
5. Generic
Paragraphs
Headings
Line Breaks
Web Prog & Dev 4
Claudine Narciso
Horizontal Rule
Lists
<ul> - unordered lists; bullets
<ol> - ordered lists; numbers
<dl> - definition lists; dictionary
Formatting
Color Codes
Red, green and blue values
bgcolor=”rgb(255,255,255)” White
bgcolor=”rgb(255,0,0)” Red
bgcolor=”rgb(0,255,0)” Green
bgcolor=”rgb(0,0,255)” Blue
bgcolor=”#cc7005”
Font
Attribute = “value” Description
size= “Num. Value 1-7” Size of your text, 7 is biggest
color= “rgb, name, or hexidecimal” Change font color
face= “name of font” Change the font type
Web Prog & Dev 5
Claudine Narciso
Text Links
Internal – links to anchor on the current page
Local – links to other pages within your domain
Global – link to other domains outside of your site
Entities
<p> Everything that goes up, must come
down!
</p>
Images
Local src Location description
src=”sunset.gif” Picture file resides in same directory as .html file
src=”../sunset.gif” Picture file resides in previous directory as .html file
src=”../pics/sunset.gif” Picture file resides in the pic directory in previous directory as .html file as .html file
Image Links
Web Prog & Dev 6
Claudine Narciso
Tables
Bgcolor
Web Prog & Dev 7
Claudine Narciso
Background
Comments
<!—Note to self: This is My First Program -->
Script
Music Codes
The attribute controls set which controls for the media player will be displayed.
Autostart – choose if the media file start automatically
Loop – sets the media file to repeat or not
Volume – set the volume of the media file. The range is 0-100
Video Codes
Flash movies (.swf), AVI’s (.avi), and MOV’s (.mov) file types are supported by the embed tag.
.swf files – are the file types created by Macromedia’s Flash program
.wmv file – are Microsoft Window’s Media Video file types
. mov files – are Apple’s Quick Time Movie format
.mpeg files – set the standard for compression movie files created by the Moving Pictures Experts Group
Div
The div tag is nothing more than a container for other tags. Much like the body tag, Div elements are block
elements and work behind the scenes grouping other tags together.
Web Prog & Dev 8
Claudine Narciso
FORMS
Text Fields
Passwords
Radio
Checkboxes
Text areas
Upload
Select
Submit
Reset
Hidden Fields