HTML 1
HTML 1
Words to remember
Tag
Used to specify special regions to the web
browser. Tags look like this: <tag>
Element
A complete tag, having an opening <tag> and
a closing <tag>.
Attribute
Used to modify the value of the HTML
element. Elements will often have multiple
attributes.
Element?
An element consists of three basic parts: an
opening tag, the element's content, and
finally, a closing tag.
<p> - opening paragraph tag
Element Content - paragraph content
</p> - closing tag
Every webpage contains four basic
elements. The html, head, title, and body
elements.
More elements
<html> begins and ends each and every web
page.
The <head> element comes next.
Tags placed within the head element are not
directly displayed by browsers.
Place the <title> tag within the <head>
element to title your page. The title will be
displayed at the top of a viewer's browser.
The <body> element is where all content is
placed. Paragraphs, pictures, tables, etc.
A Simple HTML File – ex1.html
<html>
<head>
<title>A Simple HTML Example</title>
</head>
<body>
HTML is Easy To Learn</H1>
Welcome to the world of HTML.
</body>
</html>
Exercise – ex1.html
create ex1.html which displays your Profile.
Tags
Tags are embedded commands within a
document that communicate to the browser.
<opening tag> Content </closing tag>
Any number of white-spaces are compressed
into a single one
Examples of Tags
<p>Paragraph Tag</p>
<h2>Heading Tag</h2>
<b>Bold Tag</b> or <strong> Bold Tag </strong>
<i>Italic Tag</i> or <em> Italic Tag </i>
More HTML tags
Tags Without Closing Tags
They still have the 3 basic parts
(opening/closing and content).
do not require a formal </closingtag>
Examples:
<img src="mypic.jpg" /> -- Image Tag
<br /> -- Line Break Tag
<input type="text" size="12" /> -- Input Field
Lists – un-numbered
Unnumbered Lists: Unnumbered Lists with
<UL> different pointer types:
<LI> apples </LI> <UL type="square">
<LI> bananas </LI> <LI> oranges </LI>
<LI> grapefruit </LI> <LI> peaches </LI>
</UL> <LI> grapes </LI>
</UL>
type="square"
type="disc"
type="circle"
Lists - numbered
Unnumbered Lists: Numbered Lists:
<UL> <OL>
<LI> apples </LI> <LI> oranges </LI>
<LI> bananas </LI> <LI> peaches </LI>
<LI> grapefruit </LI> <LI> grapes </LI>
</UL> </OL>
Lists - numbered
Numbered Lists that Numbered Lists with
starts with 4: different ordering:
<OL start="4"> <OL type="a">
<LI> oranges </LI> <LI> oranges </LI>
<LI> peaches </LI> <LI> peaches </LI>
<LI> grapes </LI> <LI> grapes </LI>
</OL> </OL>
type="a": a, b, c
type="A": A, B, C
type="i": i, ii, iii
type="I": I, II, III
Lists
TIPS
Use the start and type attributes to customize your
lists. It is possible to make lists of lists, which is
helpful for creating some items, such as outlines.
Put it all together so far
<HTML>
<HEAD>
<TITLE>The document title</TITLE>
</HEAD>
<BODY>
<H1>Main heading</H1>
<P>A paragraph.</P>
<P>Another paragraph.</P>
<UL> Things that I like </UL>
<LI>A list item.</LI>
<LI>Another list item.</LI>
</UL>
</BODY>
</HTML>
Block vs. Inline Elements
<h2><em>This header will be bold and
italicized</em></h2>
OR
<em><h2>This header will be bold and
italicized</h2></em>
<em> and <h2> are different kinds of tags.
<h2>: header elements are BLOCK-LEVEL
elements.
<em>: is an INLINE-LEVEL element.
Formatting
<p>An example of <b>Bold Text</b> </p>
<p>An example of <em>Emphasized Text</em> </p>
<p>An example of <strong>Strong Text</strong> </p>
<p>An example of <i>Italic Text</i> </p>
<p>An example of <sup>superscripted Text</sup> </p>
<p>An example of <sub>subscripted Text</sub> </p>
<p>An example of <del>struckthrough Text</del> </p>
<p>An example of <code>Computer Code Text</code> </p>
<center>Centering of text in page</center>
Hyperlinks
The most important capability of HTML
Both text and image can serve as anchors
for the link