Professional Documents
Culture Documents
Ch3 Notes HTML - I Basic HTML Elements
Ch3 Notes HTML - I Basic HTML Elements
Ans:-It defines the document’s body. It contains all the content of an HTML document, such as text, images,
lists, tables, hyperlinks etc.
Attributes of Body tag
1. BGCOLOR:- It is used to give background color. Eg <body BGCOLOR=”red”> the default
background color is red.
2. Background:- it is used to insert background image. .jpeg (joint picture expert group), .png (portable
network graphic, .gif (graphic interface format), .bmp (bitmap) can be inserted. Example <body
background=”abc.jpg”>
3. Text:- It is used to change text color. Example <body text=”red”>. The default text color is black.
4. Leftmargin:- it is used to change the left margin. 72 pixel is equivalent to one inch. Example <body
leftmargin=72>
5. Topmargin:- it is used to change the topmargin. 72 pixel is equivalent to one inch. Example <body
topmargin=72>
6. Link :- it is used to change default hyperlink colour which is blue.
7. VLink(visited link) :- it is used to change default visited hyperlink colour which is purple.
8. ALink :- it is used to change default active hyperlink colour which is red.
Example: <Body link=pink vlink=yellow alink=green>
Note :- <body bgcolor=”#000000”> gives black
<body bgcolor=”#FFFFFF”> gives white
Attribute:-
1. Face : it specifies font style. The user can give three styles wth this attribute.eg.
<basefont face=”broadway, arial, times new roman”> computer </basefont>
If broadway is unavailable then browser takes “arial” ,if ‘arial’ is unavailabl then “times new roman”. If
all three are unavailable then browser renders the text with default font.
2. color: it specifies font color.eg.<basefont color=red>
3. Size: it specifies font size. Eg.<basefont size=4>
Q16:- Define <hr> tag with its attribute. Or Define Horizontal line tag with its attribute.
ans:- The <hr> tag produces a horizontal line spread across the width of the browser window. It is empty tag. Its
attributes are size, width, noshade, color.
Attribute
1. SIZE:- it defines thickness of horizontal line. Default size of horizontal rule is 3 pixels. The size
attribute of <HR> is given values in terms of pixels. 72 pixel= 1 inch.
2. Width:- It defines the length of the horizontal line. It can be given in terms of pixels and percentage of
the browser window.
Eg <HR SIZE=72 WIDTH=50%>
3. NOSHADE:- It draws a 2D or flat rule.eg <HR SIZE=72 WIDTH=50% noshade>
4. COLOR:- It gives colour to the rule. <HR SIZE=72 WIDTH=50% color=red noshade>
2. Physical Text style:- it indicate the specific type of appearance for a section e.g. bold, italic etc.
Physical text style is rendered in the same manner by all browser.
Various physical text styles are:
<B>: bold text
<I> : italic text
<U> : underlined text
<TT>: typewriter text
Example:
<html>
<body>
<b> example of bold text </b>
<i> example of italic text </i>
<u> example of underlined text </u>
</body>
</html>
19Q:-Define subscript and superscript.
Ans:- to write something like H2O, you can write it as H <SUB> 2 </SUB> O. Similarly to write
something like X2, you can write it as X <SUP> 2 </SUP>.
Q20:- How can you write special characters like <,>,& in a web page?
Ans:-these special characters have special meaning in HTML and so cannot be used in HTML as text.
To use one of the three characters in HTML document, type in the following way
< : will display <
&RT : will display >
& : will display &
example
<html>
<body>
< MR. &RT
</body>
</html>
Browser window displays as:
< MR >
Type attribute: you can use this attribute with the <ol> to change the numbering style itself. With the
<ol> tag, then type attribute may have a value of A for numbering with capital letters , a for numbering
with lowercase letters, I for capital Roman numbers, i for lowercase Roman numerals, or 1 for common
Arabic numerals. The default list is Arabic numerals 1,2,3 etc.
Start attribute: The start attribute for the <OL> tag lets you change that beginning value. To start a list
at 5, eg.
<OL start=5 type=a>
<LI> ONE
<LI> TWO
</OL>
OUTPUT
e. ONE
f. two
2. unordered list:- This is bulleted lists. These lists are marked by <UL> and </UL> tags. To make a
bulleted list
1. start with an opening list <UL> tag.
2. Enter the <LI> tag followed by individual item; off tag is not required. It is optional.
3. End the entire list with a closing list </UL> tag.
Eg.
<UL>
<LI> ONE
<LI> TWO
</UL>
• ONE
• TWO
Type attribute:- by default, a solid circle is used for the bullets. However, yoy can change the bullet style
using type attribute. This attribute may have a value either disc, circle, or square eg.,<UL type= square>. The
disc is the default bullet i.e, a solid circle. Attribute value circle displays a solid square as the bullet. Eg
<html>
<body>
<UL>
<LI> ONE
<LI> TWO
</UL>
<UL type=circle>
<LI> ONE
<LI> TWO
</UL>
<UL type=square>
<LI> ONE
<LI> TWO
</UL>
</body>
</html>
• One
• Two
o One
o Two
One
two
2. Definition lists:- it is indented list without any bullet symbol or any number in front of each item. A
definition list <DL> usually consists of alternating a definition term <DT> and a definition description.
Web browsers generally format the definition on a new line and indent it.eg.
<DL>
<DT> html
<DD> hypertext markup languge
<DT> http
<DD> hypertext transfer protocol
</DT>
Compact attribute: it can be used incase your definition are very short. This option may fit on the
same line as the start of the definition.
<DL>
<DT compact> html
<DD> hypertext markup languge
<DT> http
<DD> hypertext transfer protocol
</DT>