Professional Documents
Culture Documents
Web 2 Tags and Attributes
Web 2 Tags and Attributes
Web 2 Tags and Attributes
HTML Tags
i.e. <TITLE>Welcome to my
homepage</TITLE>
Headings
Headings Example
<HTML> As displayed
<HEAD> by the browser.
<TITLE>Example
Page</TITLE>
</HEAD>
<BODY>
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<H4>Heading 4</H4>
<H5>Heading 5</H5>
<H6>Heading 6</H6>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Car Debugging</TITLE>
</HEAD>
<BODY>
<H1>Engine Tune-Up</H1>
<H2>Change The Oil</H2>
<H2>Change the Spark
Plugs</H2>
<H3>Prepare the New
Plugs</H3>
<H4>Remove the
Guards</H4>
<H4>Check the
Gap</H4>
</BODY>
</HTML>
Paragraph
Example:
<BODY>
This is the first paragraph, at the very
beginning of the body of this document.
<P> The tag above signals the start of this
second paragraph. When rendered by a
browser, it will begin slightly below the end of
the first paragraph, with a bit of extra white
space between the two paragraphs. </P>
This is the last paragraph in the example.
</BODY>
Paragraph Example
<HTML> As displayed
<HEAD> by the browser.
<TITLE>Example
Page</TITLE>
</HEAD>
<BODY>
<H1>Heading 1</H1>
<P>Paragraph 1, ... </P>
<H2>Heading 2</H2>
<P>Paragraph 2, ... </P>
<H3>Heading 3</H3>
<P>Paragraph 3, ... </P>
<H4>Heading 4</H4>
<P>Paragraph 4, ... </P>
<H5>Heading 5</H5>
<P>Paragraph 5, ... </P>
<H6>Heading 6</H6>
</BODY>
</HTML>
Example:
<BODY>
This is the first paragraph, at the very beginning
of the body of this document. <BR> The tag
above signals the start of this second
paragraph. When rendered by a browser, it will
begin slightly below the end of the first
paragraph, with a bit of extra white space
between the two paragraphs. <BR> This is the
last paragraph in the example. </BODY>
Horizontal Rule
Example:
<BODY>
This text is directly above the rule.
<HR>
And this text is immediately below.
<P>
Whereas this text will have space before the
rule.
<P>
<HR>
<P> And this text has space after the rule.
</BODY>
<HR> Attributes
<HR> Example
<HTML> As displayed
<HEAD> by the browser.
<TITLE>Example
Page</TITLE>
</HEAD>
<BODY>
<H1>Heading 1</H1>
<P>Paragraph 1,
<BR>
Line 2
<BR>
<HR>
Line 3
<BR>
…
</P>
<H2>Heading 1</H2>
<P>Paragraph 2, …
<BR>
Character Formatting
<B> Bold
<I> Italic
<TT> Monospaced typewriter font
<U> Underline
<S> Strike through
<BIG> Bigger print than the
surrounding text
<SMALL> Smaller print
<SUB> Subscript
<SUP> Superscript
<I>Italic</I>
Ø To create italic text, insert an <I> tag in the
document, followed by a </I> tag. Any text
between these two tags will be displayed in
italics when viewed by a browser.
<B>Bold</B>
Ø To create bold text, insert <B> and </B>
tags. Any text falling between these two
tags will appear in boldface type.
<S>Strike-through</S>
Ø To create strike-through text, which is text
with a single horizontal line running
through it, use the <S> and </S> tags.
Example:
<EM>emphasis</EM>
Ø When you want to add importance to a
section of text, you can use the logical style
tag called emphasis. Using the <EM> and
</EM> tags will usually display the
indicated text in italics. However,
remember that with logical tags, the actual
appearance of the text is determined by the
end user's Web browser, not your HTML
document. Example:
<P>Say it with<STRONG>emphasis</STRONG></P>
<CITE>citation</CITE>
Ø The <CITE> and </CITE> tags are used to
insert a citation to give credit for a short
quotation in the body of the document.
Citations are typically displayed in italics.
Example:
Preformatted Text
Preformatted Example
<HTML>
<HEAD>
<TITLE>
Preformatted Text
</TITLE>
</HEAD>
<BODY>
<PRE>
( )
Moo ( oo )
\ /------------\
|| |\
||-------W|| *
|| ||
</PRE>
</BODY>
</HTML>
Font Element
Function:
Set the font size for text
Attributes:
COLOR (extension), FACE (Internet
Explorer) and SIZE (extension)
End Tag:
</font>, always used
Example:
Text Alignment
<BASEFONT> </BASEFONT>
Ø Used to set the base font size. The size
attribute is an integer value ranging from 1
to 7. The base font applies to the normal
and preformatted text but not to headings,
except where these are modified using the
FONT element with a relative font size.
<BLOCKQUOTE></BLOCKQUOTE>
Ø This element is used to enclose block
quotations from other works or to indent
sections of a document. (It indents from
both sides in a browser) This element can
also contain most other formatting
elements such as Headings, paragraphs,
tables, etc.
Example:
This is the first day of the rest of your life, make it count.
180 Attwell Dr. Suite 130
Toronto, ON
M9W 6A9
HTML Tags and Attributes
Page 31 of 32
Web Development 1
Writing Comments