Sei sulla pagina 1di 11

Web Tech Practicals

By

Sanjeev Pokharel

MScIT III Semester


SMU India
[Learning Center, LBEF, CPS Maitidevi, Kathmandu]

(a)

HTML Basic

Theory: Describe About HTML

Prepared By/Solved By: Sanjeev Pokharel

Prepared By/Solved By: Sanjeev Pokharel

(b)

aa

Physical Tags
Physical tags are used to indicate exactly how specific characters are to be formatted.
The syntax or format for using a PHYSICAL TAG is as follows:
<Tag Name> Characters to be formatted. </Tag Name>
<B>

Indicates that the text should be bold.

</B>

<I>

Indicates that the text should be italic.

</I>

<TT>

Indicates that the text should be used with a font


such as Courier that allots the same width to each
character.

</TT>

Prepared By/Solved By: Sanjeev Pokharel

<BIG>

Indicates that the text should be displayed in a big font.


Available in HTML 3.0 or higher.

</BIG>

<SMALL>

Indicates that the text should be displayed in a small font. Available in


HTML 3.0 or higher.

</SMALL>

<SUB>

Indicates that the text should be displayed as a subscript, in a


smaller font if possible. Available in HTML 3.0 or higher.

</SUB>

<SUP>

Indicates that the text should be displayed as a superscript, in a


smaller font if possible. Available in HTML 3.0 or higher.

</SUP>

<U>

Indicates that the text should be displayed underlined. Not all


browsers support this tag.

</U>

Logical Tags
Logical tags are used to indicate to the visually impaired that there is some emphasizes on
the text. Each browser has its own technique as to how to indicate to its viewer that the
text between the tags are different.
The syntax or format for using a LOGICAL TAG is as follows:
<Tag Name> Character/s to be formatted. </Tag Name>

Examples of Logical Character Tags


<EM>

Indicates that characters should be emphasized in some way.


Usually displayed in italics.

</EM>

<STRONG>

Emphasizes characters more strongly than <EM>.


Usually displayed in a bold font

</STRONG>

<CODE>

Indicates a sample of code. Usually displayed in


a Courier font or a similiar font that allots the
same width to each character.

</CODE>

<KBD>

Used to offset text that the user should enter.

</KBD>

Prepared By/Solved By: Sanjeev Pokharel

Often displayed in a Courier font or a similiar


font that allots the same width to each
character.

<VAR>

Indicates a variable. Often displayed in italics or


underlined.

</VAR>

<CITE>

Indicates short quotes or citations. Often italized by


browsers.

</CITE>

1.

(c)

Theory

HTML Formatting Elements


In the previous chapter, you learned about HTML styling, using the HTML style
attribute.
HTML also defines special elements, for defining text with a special meaning.
HTML uses elements like <b> and <i> for formatting output, like bold or italic text.
Formatting elements were designed to display special types of text:

Bold text

Important text

Italic text

Emphasized text

Marked text

Small text

Deleted text

Inserted text

Prepared By/Solved By: Sanjeev Pokharel

Subscripts

Superscripts

Tag

Description

<b>

Defines bold text

<em>

Defines emphasized text

<i>

Defines italic text

<small>

Defines smaller text

<strong>

Defines important text

<sub>

Defines subscripted text

<sup>

Defines superscripted text

<ins>

Defines inserted text

<del>

Defines deleted text

<mark>

Defines marked/highlighted text

Prepared By/Solved By: Sanjeev Pokharel

Prepared By/Solved By: Sanjeev Pokharel

Pre tag:
Theory:
The HTML <pre> element (or HTML Preformatted Text) represents preformatted text. Text within this
element is typically displayed in a non-proportional font exactly as it is laid out in the file. Whitespaces
inside this element are displayed as typed.

Code:
<html>
<head><title>MyClassTimeTable</title>

<link rel="stylesheet" type="text/css" href="stylefortimetable.css">

</head>
<body>
<pre>
MyClassTimeTable
Days
First
Sunday
HSN
Monday
HSN
Tueday
HSN
Wedenesday HSN
Thursday
WebTech
Fridaty
HSN
</pre>
</body>
</html>

Second
WebTech
WebTech
WebTech
WebTech
OOAD
WebTech

Output:
MyClassTimeTable
Days
Sunday
Monday
Tueday
Wedenesday
Thursday
Fridaty

First
HSN
HSN
HSN
HSN
WebTech
HSN

Second
WebTech
WebTech
WebTech
WebTech
OOAD
WebTech

Prepared By/Solved By: Sanjeev Pokharel

Third
OSS
OSS
OSS
WebTech
OSS
OSS

Third
OSS
OSS
OSS
WebTech
OSS
OSS

3 .b.

sets the horizontal space between the image and surrounding text. VSPACE sets the
vertical space between the image and surrounding text.
Theory: HSPACE

has the most pronounced effect when it is used in conjunction with ALIGN to right or left align
the image. The following examples show HSPACE when it is not used, when it is set to 10, and when it
is set to 50.
HSPACE

Example:

<IMG SRC="pumpkin.gif" ALT="picture of a pumpkin" HEIGHT=100 WIDTH=100


ALIGN=LEFT>
Include
Hspace="10"
Vsapce="50"

4.a.

HTML links are hyperlinks.


A hyperlink is a text or an image you can click on, and jump to another document.

HTML Links - Syntax


In HTML, links are defined with the <a> tag:
<a href="url">link text</a>
Eg. <a href="http://www.w3schools.com/html/">Visit our HTML tutorial</a>

4.b.

Intradocument linking is linking to a location on the same page and to specific locations on another
web page.

Prepared By/Solved By: Sanjeev Pokharel

To link to a specific location on a web page, use an anchor tag and the id attribute.
<a href="#destination"></a>
<h1 id="destination">Heading Text</h1>

The id attribute must be a unique value and can not contain spaces.
The id can be added to any web page element that accepts global attributes.
The name specified in the id is preceded by a pound sign in the href and must match exactly.

Prepared By/Solved By: Sanjeev Pokharel

Potrebbero piacerti anche