Sei sulla pagina 1di 16

Hyper Text Markup Language (HTML)

What is HTML?

HTML provides a way for creating web pages. HTML is not a


programming language, but a markup language. An HTML
file is a text file containing small markup tags. The markup
tags tell the Web browser how to display the page. HTML is
just a series of tags that are integrated into a document
that can have text, images or multimedia content.
Types of HTML Pages:
Static
Dynamic

Static Web Page: Web pages without being able to


have any interaction with users.

Dynamic Web Page: Web Pages where the content of the web
page depend on user input. So interaction with the user is
required in order to display the web page.
A Sample HTML document
Example-1

<HTML>
<!-- This is html comment -->
<HEAD>
<TITLE> BCA </TITLE>
</HEAD>
<BODY>
This is my first html document.
</BODY>
</HTML>
A Tag tells the browser to do something. They are instructions
that are embedded in HTML documents. Tags can be:
Paired: Container tag i.e. <h1> ……. </h1>
Singular: Empty tag i.e. <hr/>, <br/>

Tag Attributes:
Additional Information applied to an HTML Tag.
Attributes are written immediately following the tag,
separated by space.
Multiple attributes can be given with a tag.
BODY Tag
All the content to be displayed on the web page has to be written
within the body tag.
Example-2
<html>
<head>
<title>BCA</title>
</head>
<body bgcolor="yellow" text="red">
This is a sample <br/>
html document.
</body>
</html>
The BODY tag has following attributes:

BGCOLOR: It can be used for changing the background colour of


the page. By default the background colour is white.
BACKGROUND: It is used for specifying the image to be displayed
in the background of the page.
LINK: It indicates the colour of the hyperlinks, which have not
been visited or clicked on.
ALINK: It indicates the colour of the active hyperlink. An active
link is the one on which the mouse button is pressed.
VLINK: It indicates the colour of the hyperlinks after the mouse is
clicked on it.
TEXT: It is used for specifying the colour of the text displayed on
the page.
The colour of background or text can be specified using colour name
or hexadecimal RGB colour values. The range of allowable values in
hexadecimal format is from “#000000” to “#FFFFFF”.

Example-3
<html>
<head>
<title>BCA</title>
</head>
<body bgcolor="#00ff00" text="#ff0000">
BASIC CONCEPTS OF WEB DESIGN
</body>
</html>
Tags for Basic Text Formatting

Headers: From <H1> to <H6>


Bold, Italics and Underline:
<B> or <STRONG>, <I> or <EM>, <U>
Others: <CENTER>, <BR>, <P>, <PRE>,
<STRIKE>, <DEL>, <INS>, <SUB>, <SUP>
<html> Example-4
<head>
<title>BCA</title>
</head>
<body background="logo.jpg">
<center>SAMPLE DOCUMENT <br/>
This is <b> Basic</b> formatting
of <i> Text</i> and <u>Alignment</u>.<br/>
The Same is &lt;strong&gt; <strong> tag
for bold</strong> and &lt;em&gt;<em> tag
for italic</em>
</center>
</body>
</html>
Example-5
<html>
<head>
<title>BCA</title>
</head>
<body bgcolor="#00ffaa" text="red">
<strong>
1st Rank in India<br/>
1<sup>st</sup> Rank in India<br/>
Product Price:
MRP:<del> 25000/-</del>2500/-<br/>
Deal Price: <strike> 1200/- </strike> 600/-
</strong>
</body>
</html>
<html> Example-6
<head>
<title>BCA</title>
</head>
<body>
<center><b>HTML BASIC TAGS</b></center>
<hr align="center" width="75%" size="5px" color="red" />
<pre>
We can use
some basic text formatting using
html tags
</pre>
</body>
</html>
FONT Tag Example-7

<html>
<head>
<title>BCA</title>
</head>
<body>
<font size="3" color="red">BCA Web Design</font><br/>
<font face="arial" size="5" color="green">BCA Web
Design</font><br/>
<font face="monotype corsiva" size="7" color="blue">BCA Web
Design</font>
</body>
</html>
Special Characters
They have special meaning in HTML.
It has 3 parts:
An Ampersand (&)
An Entity Name
A semicolon (;)

Character Entities Meaning/Discription


&nbsp; non-breaking space
&lt; < (less than symbol)
&gt; > (greater than symbol)
&#x20b9; or &#8377; Rupee Symbol
&copy; © Copyright
&reg; ® Registered trademark
IMG tag
This tag is used for inserting an image with specified width and
height.
<IMG SRC=“filename” WIDTH=“value” HEIGHT=“value”
ALT=“Alternate Text” BORDER=“value” />

SRC: pathname of source file.


WIDTH: specified width of image.
HEIGHT: specified height of image.
ALT: if the browser is not able to display the image then
alternate text is used.
BORDER: it is for border width.
IMG Tag Example:
Example-8
<html>
<head>
<title>BCA</title>
</head>
<body>
<img src=“logo.jpg" width="150" height="150" alt="welcome"
border="20%"/>
</body>
</html>

Potrebbero piacerti anche