HTML
HTML
Introduction to HTML
HTML
HTML stands for Hyper Text Markup Language.
Markup Language is a way of writing style and layout information
within a text document.
HTML is a simple scripting language, mainly used for developing
web pages.
HTML document is a plain text file that contains text and HTML tags.
This document when viewed in a browser displays a web page.
• HTML is not a programming language but a markup language.
• It creates simple text files using any HTML editor.
• It consists of markup tags.
• It is saved with the extension of .htm or .html.
• It is not case sensitive, that is, <HTML>,<html>or< HTml>are the
same.
HTML Editor
HTML editor is a software application required to write HTML tags to
create web page.
WYSIWYG Editor
WYSIWYG stands for ‘What You See Is What You Get’.
The content displayed onscreen during editing phase closely resembles
the final web page.
Test Editor
To work with a text editor, you must know how to write HTML tags that
are used for creating a web page.
1. Click on the Start button All Programs Accessories
Notepad.
2. The Notepad window appears. Type the HTML code (Fig. 8.1) page
number 97.
3. Click on the File menu Save As option.
4. Save As dialog box appears. Save the file with any name and ‘.html’
or ‘.htm’ extension.
Viewing an HTML Document Using a Web
Browser
1. Container Tags: These tags have a start and an end tag to an HTML
element. (Eg: <B>…</B>, <BODY>…</BODY>, etc.
2. Empty Tags: These tags have only an opening or a start tag and no
closing tag to an HTML element. (Eg: <LI>, <IMG> <HR>,etc.
HTML Elements
The content typed along with the start tag and the end tag is called the
HTML elements.
HTML Tag Attributes
Attributes of a tag provides additional information about the HTML
elements.
Attributes appear as an attribute name followed by an ‘=’ sign and then
the attribute value. (Eg: <IMG align=“left”>
Structure of an HTML Document
All HTML documents contain standard HTML tags that are
executed in a web browser.
Root Element
This contains the HTML tag. It is a container tag. It is used to detect the
document as an HTML document.
Head Element
<HEAD>
<TITLE>
Click Start- Learning HTML
</TITLE>
</HEAD>
</HTML>
Body Element
This element defines the document’s body.
(Fig. 8.4)
<HTML>
<HEAD>
<TITLE>
Click Start – Learning HTML
<BODY>
</TITLE>
</HEAD>
</BODY>
</HTML>
The followings are some important attributes of the <BODY> tag:
1. Text: This attribute specifies the color of the text of the entire
document. The value can be the name of the color within quotes.
2. Bgcolor: This attribute specifies the color of the background of the
web page.
3. Leftmargin: This attribute sets the left margin of the web page. The
value can be given as a number or in percentage.
4. Topmargin: This attribute sets the margin at the top of the web
page. The value van be given as a number or in percentage.
5. Background: This attribute will make an image as the background
of the web page.
Some Important Points
• The space between the tags does not matter. (Eg: <U>Underline
text</U> is same as <U>Underline text </U>)
• There should not be any space between letters of the tag names. (Eg:
<HTML> is correct; <HTML>, <HTML>, <HTML> are correct.
• Attributes are always specified with the tag they belong to.
• Attribute name is not case sensitive.
HTML Document Heading
Heading tags are used to display a text slightly bigger & bolder than
normal body text. HTML has six levels of headings, numbered 1 to 6,
with 1 being the main heading and largest in size.
Fig. 8.6
<HTML>
<HEAD>
<TITLE>Heading Tags</TITLE>
</HEAD>
<BODY>
<H1> First level heading </H1>
<H2> Second level heading </H2>
<H3> Third level heading </H3>
<H4> Fourth level heading </H4>
<H5> Fifth level heading </H5>
<H6> Sixth level heading </H6>
</BODY>
</HTML>
HTML Paragraph Tag
While writing an HTML document, all kinds of spaces are ignored
including blank lines and the Entry key.
Fig. 8.7
<P> Paragraph 1 </P>
<P> Paragraph 2 </p>, so on
<HTML>
<TITLE> words of wisdom
</TITLE>
<BODY>
<P> Wisdom is only found in truth. </P>
<P> Good health is above wealth. </P>
</BODY>
</HTML>