STD 7 - HTML
STD 7 - HTML
Tags : - Tags are HTML codes that tell browser how to display data. They are always
written inside < > angle brackets. A tag when opened is written like <title> and when
closed is written with a / sign like </title>.
Ex - <title>My First Web Page </Title>.
Remember HTML tags are not case sensitive.(Uppercase or Lowercase does not matter)
Tags are of two types:
Container Tags : - These tags need to be opened and closed. For Example <u>St.
Michael’s</u>. If closing tag is missed, browser may assume the tag is closed in the
end of document and there may be no difference in result. But for your level, closing
of container tag is mandatory. Failing which you may loose marks for the simple
reason – “Examiners are not browsers”.
Empty Tags : - These tags need to be opened but not closed. For Example <HR>. They
just carry out their job and continues.
STD VII HTML R. PATHAK
HTML Tags
Attributes : - Attributes are supporting parameters of tags. They enhance the impact
of tag. They are used along with the opening tag inside < >.
For Example : <Font size=5 color=red> St. Michael’s</Font>.
Here, Font is a container tag. Size and Color are its attributes. 5 and red are the value
of attributes respectively. So, more than one attribute separated by space can be used.
<HTML> <HTML>
<HEAD> <HEAD>
--- --- --- Correct --- --- ---
</HEAD> <BODY>
<BODY> </HEAD>
Incorrect
--- ----- --- --- ----- ---
(Overlapping)
</BODY> </BODY>
</HTML> </HTML>
STD VII HTML R. PATHAK
Steps to Create HTML Document
1. Open Notepad. Notepad is a text editing application.
Start-> Program -> Accessories ->Notepad <HTML>
2. Type the HTML code given . <HEAD>
3. Save the document –
<Title>
Click File-> Save As
Welcome</Title>
Select Desktop as Folder Name on top
Change Save as Type in bottom from Text Documents to </HEAD>
All Files. <BODY>
Type First.html in File Name
<P> Welcome</P>
Click Save.
<P> To</P>
Steps to View and edit document. <P> HTML</P>
1. If you have done it correctly, you should get file on desktop in </BODY>
the name of First with browser’s icon. If you are not getting,
recheck and redo the saving part. </HTML>
2. Now you have a document First.html on desktop .
3. Double Click the document. It is opened by browser giving you
the web page.
4. The same document if you Right Click and select Open with
Notepad opens in text editing mode .
5. To make changes open the document in Notepad, make
changes, save the document and reopen in browser to see the
effect.
STD VII HTML R. PATHAK
HTML Tags & Attributes
HTML tag : It is a Container Tag & Root Tag. It marks the beginning and end of a
html document. It is also a root element. All other elements of the html document
will be used inside this tag. Though it has many attributes, to configure document to
a global environment, we learn given ones only.
Attribute Value Description
dir ltr, rtl Sets the direction of page Left to Right/Right to Left
lang en, hn, sp, fr etc. Code of language for the page
Ltr is default value for dir and en is default for lang. Default means, if we don’t use these attributes, browser
assumes default value. So, <HTML> or <HTML dir=ltr lang=en>, both will have same effect on browser.
HEAD Tag: It is a Container Tag , used inside HTML tag and outside BODY tag. This element is
the container of a set of elements that is used to give heading and title text to a web page. Other data
may be used inside HEAD tag. But we will avoid. Head tag does not have any attribute.
BODY Tag : It is a Container Tag , used inside HTML tag and outside HEAD tag. The
body element is the container for all aspects of a document that we want the users/visitor of the
page to see. It contains all other tags, data and hyperlinks of the page. It has following attributes
Attribute Value Description
text Any colour code Sets the default colour for regular text inside the tag.
bgcolor Any colour code Sets the default colour for background of the page.
Highlighting Tags: These container tags are used to highlight/emphasize contents. They are
usually used inside <p> tag.
Tag Description HTML Code Output
<B> Boldfaces contents <P> St. <B>Michael’s</B> High School </P> St. Michael’s High School
<I> Italics contents <P> St. <I>Michael’s</I> High School </P> St. Michael’s High School
<U> Underlines contents <P> St. <U>Michael’s</U> High School </P> St. Michael’s High School
Face Any font name. Default is browser’s font face Sets face for the given text.
Color Any colour’s name or hexadecimal code. Default is browser’s font Sets the colour for the text.
color (Usually black)
Size Any value between 1 -7. Default is browser’s font size usually size 3. Set the font size for the text
Heading Tags :There are 6 container tags H1,H2, H3, H4, H5, H6 used inside body tag to give Headings
to web page. They are actually combination of P and Font tag. Content of these tags will behave as a
paragraph. H1 will give Font size 7, H2 - Font size 6, H3 - Font size 5, H4 - Font size 4, H5 - Font size 3
and H6 will give Font size 2. All of them have only one attribute.
Thank You.
STD VII HTML R. PATHAK