You are on page 1of 26

HTML BASICS

WHAT IS HTML?

 HTML stands for Hyper Text Markup Language.


 HTML is not a programming language like Java, C++; rather it
is simply a markup language.
 HTML documents are also called WEB PAGES.
 Web browsers retrieves web pages from web servers that can
be anywhere in the world and rendered through INTERNET.
What are Markup Languages?

It is a way of describing how a set of text & images


should be displayed to the viewer, similar in concept to
a newspapers editor’s markup symbols.
The document prepared by this language is special
kind of text document used by web browsers to
present Text & graphics.
HTML is just a markup
language used to display
text and images to the
viewer.
HTML TERMS
1. TAG- <tag> or <TAG>

 It is used to specify(“mark-up”)
regions of HTML documents for
the Web Browsers to interpret.
 A <tag> specifies browser what is
to be done.
 Tags are case-sensitive.
 A tag looks like- ‘<’ ‘>’, and is
always represented in angle-
brackets.
2. ELEMENT

 Is a complete tag having an


opening <tag> & closing </tag>
 Eg-
<tag> // tells the browser that a
tag has opened

……..
……..
</tag> // tells the browser that a
tag has ended
3. ATTRIBUTE

 An attribute is placed inside the <tag>.


 It tells the browser what is to be done.
 The default value is the value that the browsers assumes if you have
not told it otherwise.
 Attributes are used to modify value of HTML elements.
 A tag often has multiple attributes.
A tag is a command the web
browser interprets, an element
is a complete tag & an
attribute customizes or modifies
HTML elements.
4. Nesting of Tags-
 Tags generally occurs in begin-end pairs.
 These pairs are in the form - <tag>…. </tag>.
 <Tag>- indicates opening tag.
 </Tag>- indicates closing tag.
 Opening and closing tag together are called “containers” or “container
tags.”
 Any content written within the container tag has to follow the rules of
container applied to it.
Eg- A paragraph is defined using a
paragraph container.
Cont..
 Tags as container helps in balancing the document & also in Nesting.
 Nesting- when you want to use more than one tag for same element it
is called Nesting.

<tag 1> <tag 1>


<tag 2> Correct
<tag 2>
…. ….
…. ….
</tag 2> Incorrect </tag 1>
</tag 1> </tag 2>
5. Whitespaces in the structure-

 In HTML arrangement of text & whitespaces are irrelevant.


 Whitespaces- are all blank areas in a text file say, empty lines, extra
spaces & so on.
 Outside the paragraph tag whitespaces does not matter.
 Hence to remove the above problem the Empty Tag “<br>- break the
line is used.”
Cont..

Eg- within a paragraph container, “<p>…..</p>”, all the


text can be within one long line, or in series of
separate lines or with every word in new line or each
word separated from other by 20 Spaces– all these
lines would be displayed inexactly similar manner.
Hence Whitespace does not matter or does not
changes the output.
Example of Whitespaces
OUTPUT
DOCUMENTS TAGS

 They define overall structure of the HTML


document.
 All HTML documents are divided into 2 parts-
HEAD and BODY
 4 basic tags HTML document must have are-
<HTML>, <HEAD>,<TITLE>, <BODY>.
CONT..

<HTML>- this tag tells the browser that this is an


HTML document and not a text file &
hence it needs to be converted into an
object code for its execution.

- Everything in the document goes inside


<HTML> tag.
CONT..

<HEAD>- contains “<title>..</title>” of your


document or general information.

- it is like a cover page of the book. Like it


contains details of book, similarly, <head>
contains details of HTML document
under <TITLE>.
CONT..

<TITLE>- always comes under <HEAD>.

- the text inside <TILTE> is not displayed


in the document, rather it is displayed in
the browser tab, on the top of window-
also called title bar.
CONT..

<BODY>- holds all contents- words, pictures,


artworks ,text, headers, tables, images,
frames, forms, hyperlinks etc.

- it holds everything that is to be displayed.

- it defines the visible section of the


document.
Cont..

<HTML>
<HEAD>
<TITLE> ……….. </TITLE> HEAD SECTION
</HEAD>

<BODY>
.
. BODY OF HTML
.
..
..
</BODY>
</HTML>
CONT..
output
Using image Marquee and
anchor tags

You might also like