You are on page 1of 7

Click Here To Go On Full Playlist | Click Here To Download App

Chapter 3

Basic HTML Elements

 Introduction to web page designing using HTML: create and save an HTML document, access a
web page using a web browser.
 HTML tags: html, head, title, body and its attributes,
 br (break), hr(horizontal rule), h1..h6 (heading), p (paragraph), b (bold), i (italics), u (underline)
 Inserting comments
 HTML List: ul (unordered list), ol (ordered list), and li (list item), Description lists: dl, dt and dd.
 Attributes of ol (start, type), ul (type).
 Font tags (attributes: face, size, color).

Q1: What is HTML? or What is use of HTML ?


Ans: HTML stands for Hypertext Markup Language. HTML is used to create structure, layout and
Behavior of Web page. HTML is not a programming language, it is a markup language. HTML is not
case sensitive language

Or

HTML is used to design any web page.

Q2: Write History of HTML.


Ans: 1980 GML (General Markup Language)
1986 SGML (Standard General Markup Language)
1995 HTML (Hypertext Markup language)

Version:
HTML (Version 1)
HTML (Version 2)
HTML (Version 3)
HTML (Version 4)
HTML (Version 5)

Q3: How can we work with HTML?


Ans: We need two basic tool to work with HTML:

 HTML Editor : To write HTML codes


 Browser: To view the webpage.

Types of HTML Editor:

1. WYSIWYG (What You See Is What You Get): - Example: Adobe Dreamweaver.
2. Text Editor: - Example: Notepad.

Q4: How to create HTML document?


Ans:
Step1: Open Notepad.
Step2: Write Basic Structure of HTML.
Step3: Save the document with .HTML extension. Example: Demo.html

Q5: How to view or open the HTML document?


Ans: Just double click on your HTML document and it displays your document on your computer
screen.

Q6: What is tag or Element?


Ans: Tags are the building blocks of a webpage. They contain elements which define how the
information on the webpage is formatted or displayed.
Syntax: <p> some text</p>

On Tag Off Tag

Types of Element or Tags:

There are two types of elements:

1. Container Tags:- The elements that include both ON tag and OFF tag are called container tag.
Ex: <b> This makes the text bold </b>
2. Empty Tags: Empty tag contain only ON tag.
Ex: <br>, <hr > and <img>
Q7: What is Attribute in HTML Tag?
Ans: An attribute is a property that provides additional information about an HTML tag. Attribute
always specified in ON tag.
Syntax: <tagname attrname=”Value”> text </tagname>
<body bgcolor=”red”> text </body>

Q8: Write basic structure of HTML document?


<HTML>
<head>
<title> This is my first web page </title>
<head>
<body>
<h1> Text </h1>
</body>
</html>
 <html> tag:- It is used to identify that it is a standard HTML document.
 <head> tag:- It provide information that is important about the web page.
 <title> tag:- It contains the title of the document.
 <body> tag:-It contains the content of your document which gets displayed on the web page
of your browser.

Q9: Write some common HTML container tags or Element?


Ans:

1. Heading Tag <H1> to <H6>


It defines Heading levels and there are six heading levels:

<h1> Some text</h1>


<h2> Some text</h2>
<h3> Some text</h3>
<h4> Some text</h4>
<h5> Some text</h5>
<h6> Some text</h6>

2. <P> Tag:
Marks a block of text as a paragraph.
Ex: <p> Text </p>
3. <Center> Tag:
Align text to the center of the page.
Ex: <center> text </center>

Q 10: What is empty tag? Write about some common empty tag.
Ans:
These tags having only the ON tag and perform some specific functions on their own. Ex: <br>,
<hr>,<img>.

<br> tag: It stands for Breaking Rule. This tag is used to break a line and displays the proceeding text
in next line.
Ex: <BR>
<hr> tag: It stands for Horizontal rule. This tag is used to separate block of text by creating Horizontal
line.

Atrribute of <HR> tg:

 Size: Specifies the thickness of line in terms of pixels.


Ex: <hr size=20>
 Width: Specifies the length of the line.
Ex: <hr width=”75%”>
 Align: Specifies alignment of the line.
Ex: <hr align=”left”>
 Noshade: Produce a 2D, unshaded, dark gray line.
Ex: <hr Noshade>
 Color: It is used to set color of the line.
Ex: <hr color=”blue”>

Q10: What is Comment Tag?


Ans: Comment tag is useful for programmer as they can write notes for themselves explaining the
source code.
In HTML, comments are not displayed in the browser.
Ex: <!--some text-->

Q11: What are formatting tags?


Ans: Some formatting tags are:

 <b> Tag: For bold text <b> text </b>


 <i> tag: for italic text <i> text</i>
 <u> tag: for underlined text <u> text </u>
 <sub> tag: Display the text or number in subscript form.
Ex: H<sub>2</sub>O
Output: H2O
 <sup> Tag: Display the text or Number in Superscript form.
Ex: X<sup>2</sup>+Y<sup>2</sup>
Output: X2+Y2

Q12: What is < font> tag?


Ans: The <font> tag help in displaying of the text in a presentable manner.
It has three Attributes:

1. Face: The face attribute is used to change the font type or name of font.
Ex: <font face=”Arial”> Text <font>
2. Size: This is used to change size of the font to be displayed.
Ex: <font size=”7”> Text <font>
3. Color: The color attribute changes the color of the text.
Ex: <font color=”red”> Text <font>

<Font> tag <Basefont> tag


Apply on only text enclosed between its Apply on full page at once
tags
Supported by all the Browser Not Supported by only all Browser
Container tag Empty tag

Q13: Write attribute of body tag.


Ans:

 Background: This attribute is used to set background image of page by specifying the path.
Ex: <body background=”flower.jpg”>
 Bgcolor: This attribute is used to change background color of the page.
Ex: <body bgcolor=”red”>
 Text: This attribute is used to change the color of webpage.
Ex: <body text=”red”>
 Link: This attribute is used to specify the color of the unvisited links in the web pages.
Ex: <body link=”red”>
 Alink: This attribute specifies the color of active link in the webpage.
Ex: <body alink=”Red”>
 Vlink: This attribute specifies the color of the link after it has visited.
Ex: <body vlink=”red”>
 Topmargin: This attribute is used to set top margin from the top side of a webpage.
Ex: <body topmargin=”20”>
 Leftmargin: This attribute is used to set left margin from the left side of a webpage.
Ex: <body leftmargin=”20”>

Q14: What is List in HTML?


Ans: List is most efficient way of representing data in specific order or sequence. Ex: List of grocery,
List of ingredients in a recipe.

Q15: Write different Types of Lists in HTML.


Ans: Types of Lists are:

1. Unordered List: It is used to display items without any order. It is also known as Bulleted List.
It has one Attribute:
Type: - To change the bullet style.
Ex:
<ul type= “Disc” | “Circle” | “Square” >
<li> Pen </li>
<li> Eraser </li>
<li> Pencil </li>
</ul>

2. Ordered List: It is used to display items in any specific order. It is also known as Numbered list.
It has two Attribute:
Type: - To change the numbering style.
Start: - To specifies starting value of the first item.
Ex:
<ol type=”1” | “A” | “a” | “I” | “I” Start = “3”>
<li> Pen </li>
<li> Eraser </li>
<li> Pencil </li>
</ol>

3. Definition/Description list: It shows list items in the form of a term and its description. It uses
<DL> tag, <DT> and <DD>.

<DL> Definition/Description list.


<DT> Definition Term.
<DD> Definition Data.
Q16: What is Nested List?
Ans: A list created within a list is called Nested List.

<ul >
<li> Pen
<ol >
<li> Pen </li>
<li> Eraser </li>
<li> Pencil </li>
</ol>
</li>
<li> Eraser </li>
<li> Pencil </li>
</ul>

You might also like