Documente Academic
Documente Profesional
Documente Cultură
LEARNING OUTCOMES:
At the end of the session, the students should be
able to:
1. Understand how HTML works;
2. Explore the uses of different Tags and Attributes;
3. Create a simple static Website.
What is HTML?
• Stands for Hypertext Markup Language
• Is not a true programming language.
• HTML is used to create electronic documents that
can be read on many different systems using
software called BROWSER.
• 1980’s Dr. Tim Berners-Lee wrote a small computer
program.
• An html file must have an .htm or .html file
extension.
Hypertext
- is the method by which you move around on
the web — by clicking on special text
called hyperlinks which bring you to the next
page.
Markup
- is what HTML tags do to the text inside
them.
HTML is a Language
- as it has code-words and syntax like any
other language.
HTML Structure
HTML Structure
HTML ELEMENT<html></html>
• begins and ends each and every web page.
• Its sole purpose is to encapsulate all the HTML code and describe the HTML
document to the web browser.
• Remember to close your HTML documents with the corresponding </html> tag
at the bottom of the document.
HEAD ELEMENT<head></head>
• is "next" as they say
• The head functions "behind the scenes."
• Tags placed within the head element are not directly displayed by web
browsers.
TITLE ELEMENT<title></title>
• Place the <title> tag within the <head> element to title your page.
• The words you write between the opening and closing
<title></title> tags will be displayed at the top of a viewer's
browser.
BODY ELEMENT<body></body>
• The <body> element is where all content is placed. (Paragraphs, pictures,
tables, etc).
• It will encapsulate all of your webpage's viewable content.
HTML - ELEMENTS
• An HTML element is defined by a starting tag.
• If the element contains other content, it ends with
a closing tag
• Three basic parts:
• Opening Tag - <p>
• Element Content - words/sentences/paragraph
• Closing Tag - </p>
HTML - ELEMENTS
<html>
<head>
<title>HTML-Elements</title>
</head>
<body>
</body>
</html>
See output...
CC101 – Introduction to Computing
10
LESSON 5– HTML
HTML - ELEMENTS
Header Tag
• Any document starts with a Example:
heading. You can use <html>
<head>
different sizes for your <title>Heading Example</title>
headings. </head>
<body>
• HTML also has six levels of
headings, which use the
elements <h1>, <h2>, <h3>,
<h4>, <h5>, and <h6>.
• <h1>content</h1>
</body>
</html>
See Output...
CC101 – Introduction to Computing
14
LESSON 5– HTML
Paragraph Tag
• The <p> tag offers a Example:
<html>
way to structure your <head>
text into different <title>Paragraph Example</title>
</head>
paragraphs.
<body>
• <p>Content</p>
</body>
</html>
See Output...
Centering Content
• You can use Example:
<html>
<center> tag to put <head>
any content in the <title>Centering Content Example</title>
</head>
center of the page
<body>
or any table cell. <p>This text is not in the center.</p>
• <center> content
<p>This text is in the center.</p>
</center>
</body>
</html>
See Output...
Horizontal Lines
Example:
• Horizontal lines are <html>
used to visually break- <head>
up sections of a <title>Horizontal Line Example</title>
document. </head>
<body>
• The <hr> tag creates <p>This is paragraph one and should
a line from the be on top</p>
current position in the
document to the right <p>This is paragraph two and should
be at bottom</p>
margin and breaks the </body>
line accordingly. </html>
• <hr /> See Output...
Preserve Formatting
• Sometimes, you want Example:
<html>
your text to follow the <head>
exact format of how it <title>Preserve Formatting Example</title>
is written in the HTML </head>
document. <body>
HTML – ATTRIBUTES
• Used to define the characteristics of an HTML
element and is placed inside the element's opening
tag.
• All attributes are made up of two parts: a name and a
value:
• The name is the property you want to set.
• The value is what you want the value of the property to be
set and always put within quotations.
• Ex:
• <p align =“left”>This is left aligned</p>
<body
specifies the background
background background=“picture.jpg”>
image of the page.
</body>
HTML – FORMATTING
BOLD TEXT <b>Content</b>
TEXTSUPERSCRIPT <sup>Content</sup>
TEXTSUBSCRIPT <sub>Content</sub>
HTML – IMAGES
• also called pictures, graphics, icons, clip art, etc.
Major graphic file formats
JPEG- (Joint Photographic Experts Group)
TIFF- (Tagged Image File Format)
PNG- (Portable Network Graphics)
GIF- (Graphic Interchange Format)
BMP - (Bit Mapped)
• <img>
align Specifies the appearance of the text that is near an inline graphic image.
Provides a textual direction of images when the visitor places the mouse
alt
pointer over the image.
border Specifies the width border around an image.
height Specifies the vertical dimension of an image.
Establishes a margin of white space to the left and right of a graphic
hspace
image.
vspace Establishes a margin of white space above and below a graphic image.
width Specifies the horizontal of an images.
HTML -LISTS
• HTML offers web authors three ways for specifying
lists of information.
• All lists must contain one or more list elements.
Lists may contain:
• <ul> - An unordered list. This will list items
using plain bullets.
• <ol> - An ordered list. This will use different
schemes of numbers to list your items.
• <dl> - A definition list. This arranges your items
in the same way as they are arranged in a
dictionary.
UNORDERED LISTS
• <ul><li>Content</li></ul> Example:
• a collection of related <html>
items that have no special <body>
order or sequence. <ul>
• Each item in the list is <li>Beetroot</li>
marked with a bullet. <li>Ginger</li>
specify the type
<li>Potato</li>
of bullet you <ul <li>Radish</li>
type
like. By default, type=“square”> </ul>
it is a disc. <li>Potato</li>
</body> </html>
(square, disc, </ul>
circle) See output...
ORDERED LISTS
• <ol><li>Content</li></ol> Example:
• If you are required to put <html>
your items in a numbered <body>
list instead of bulleted. <ol type=“i” start=“4”>
<li>Beetroot</li>
• The numbering starts at
<li>Ginger</li>
one and is incremented
<li>Potato</li>
by one for each
<li>Radish</li>
successive ordered list </ol>
element </body> </html>
See output...
DEFINITION LISTS
• <dl><dt>Term</dt><dd>Definition</dd></dl>
• entries are listed like in a <html>
dictionary or <body>
encyclopaedia. <dl>
• The definition list is the <dt><b>HTML</b></dt>
ideal way to present a
glossary, list of terms, or <dd>This stands for Hyper Text
Markup Language</dd>
other name/value list.
• Definition List makes use of <dt><b>HTTP</b></dt>
following three tags. <dd>This stands for Hyper Text
Transfer Protocol</dd>
• <dl></dl> - Defines
the start of the list </dl>
• <dt></dt> - A term </body> </html>
• <dd><dd> - Term See output...
definition
CC101 – Introduction to Computing
38
LESSON 5– HTML
HTML - FRAMES
• HTML frames are used to divide your browser
window into multiple sections where each section
can load a separate HTML document.
• A collection of frames in the browser window is
known as a frameset.
• <frameset>
<frame />
• </frameset
CONCEPT OF FRAME
Gallery.html
Home.html
About Us
About Us.html
Gallery
=
Contact Us Contact Us.html
<html>
<head>
<title>HTML Frames</title> </head>
<frameset cols="30%,40%,30%">
<frame name="top" src="align.html" />
<frame name="main" src="list.html" />
<frame name="bottom" src="src.html" />
</frameset>
</html>
HTML - FORMS
• HTML Forms are required, when you want to
collect some data from the site visitor.
<form> Form Elements here </form>
HTML Form Controls
• Text Input Controls
• Checkboxes Controls
• Radio Box Controls
• Select Box Controls
• Clickable Buttons
• Submit and Reset Buttons
CC101 – Introduction to Computing
47
LESSON 5– HTML
Form Sample
48
CC101 – Introduction to Computing
LESSON 5– HTML
51
CC101 – Introduction to Computing
LESSON 5– HTML
<form>
Allows to specify the width of
<input type=“text” name=“Last
Size the text-input control in terms of
name” value=“angela” size=“10”/>
characters
</form>
<form>
Allows to specify the maximum <input type=“text” name=“Last
Maxlength number of characters a user can name” value=“ angela” size=“10”
enter into a text box. maxlength=“10”/>
</form>
52
CC101 – Introduction to Computing
LESSON 5– HTML
CHECKBOX CONTROLS
• Used when more than <html>
</body>
one option is required <form>
to be selected. Choose what fruit/s do you like:<br>
<input type="checkbox" name="Apple"
checked>Apple<br>
• <form> <input type="checkbox"
name="Orange">Orange<br>
• <Input /> <input type="checkbox"
name="Grapes">Grapes<br>
• </form> </form>
</body>
</html>
See Output...
54
CC101 – Introduction to Computing
LESSON 5– HTML
56
CC101 – Introduction to Computing
LESSON 5– HTML
SELECT BOXCONTROLS
• Also called drop down box <body>
which provides option to list <form>
down various options in the <select name="dropdown">
form of drop down list, from <option value="Maths"
where a user can select one or
more options. selected>Maths</option>
• <form> <option
• <select> value="Physics">Physics</
• <option></option> option>
• </select> </select>
• </form> </form>
</body>
See Output...
58
CC101 – Introduction to Computing
LESSON 5– HTML
BUTTON CONTROLS
• Create clickable <body>
buttons. <form
• <form> action="centertag.html">
• <input> <input type="submit"
• </input> name="submit"
• </form> value="Submit" />
</form>
</body>
See Output...
60
CC101 – Introduction to Computing
LESSON 5– HTML
The end.
Thanks for Listening.
62
CC101 – Introduction to Computing