0% found this document useful (0 votes)
124 views

CLASS 7 Working With HTML 1

Here are the answers to the HTML exercise questions: 1. HTML tags are markers enclosed in angle brackets (< >) that define the structure and layout of a web page by describing its paragraphs, headings, lists, links, and other elements. 2. The text of the Title tag is displayed in the browser tab or page title bar. 3. The steps involved in creating a simple HTML document are: - Open a text editor - Add <html>, <head> and <title> tags - Add <body> tag - Add content like paragraphs, headings, images etc - Save the file with a .html extension 4. The comment tag <!-- --> is used to add comments in HTML

Uploaded by

chotu bhanu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

CLASS 7 Working With HTML 1

Here are the answers to the HTML exercise questions: 1. HTML tags are markers enclosed in angle brackets (< >) that define the structure and layout of a web page by describing its paragraphs, headings, lists, links, and other elements. 2. The text of the Title tag is displayed in the browser tab or page title bar. 3. The steps involved in creating a simple HTML document are: - Open a text editor - Add <html>, <head> and <title> tags - Add <body> tag - Add content like paragraphs, headings, images etc - Save the file with a .html extension 4. The comment tag <!-- --> is used to add comments in HTML

Uploaded by

chotu bhanu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

HTML DOCUMENTS

• HTML document are plain text files that can be created


using any text editor.
What is HTML file?
• HTML stands for hyper text markup language.
• A HTML file is a text file containing small, markup tags.
• The markup tags tell the web browser how to display the
page.
• An HTML file must have .htm or .html file extension.
• A HTML file can be created using a simple text editor.
• HTML is not case sensitive.
• HTML documents are structured in two parts , the HEAD
and the BODY.
• The Body element contains all contents of a document, as
opposed to the HEAD, which contains information about
the document.
Now how to create a webpage?
• HTML documents are plain text files which are created using any text editor
(Notepad, gedit).

• An HTML file must have the extension as .html or .htm

• Structure of an HTML document


<html>
<head>
<title> title of the page </title>
</head>
<body>
Content
</body>
</html>
Lets try hands on this…
What does an HTML document contain?
It is made up of elements called Tags and attributes which indicate the browser
how to display the web page.

An HTML element is everything from the start tag to the end tag:
 
Tag (element) – is an HTML element that indicates how information
should be displayed. A tag is enclosed in angular brackets (< >). Eg. <HEAD>,
<TITLE> etc.
• the An HTML element starts with a start tag / opening tag ie. <tagname>
• An HTML element ends with an end tag / closing tag ie.</tagname>
There are two types of tags:
Container tag – has an ON and OFF tag. They have text enclosed within
them.eg. <BODY>, <HEAD> etc. A tag is closed as </tagname> eg. </HTML,
</HEAD>
 
Empty tags – they require only ON tag. They don’t have content within them.
Eg. <BR>, <HR>
 
The following output appears in the Web Browser.

Try practically the first page example. Write the code in


your register/copy and draw the output after trying.
• An Element is a fundamental component of
the structure of a text document.
• Some examples of elements are heads, title,
body etc.

• Some elements may include an attribute,


which is additional information that i s
included inside the start tag.
HTML tags
• <html>- describes an HTML document
• <head> -contains general information or meta-
information, about the document. It has <title> with it.
• <title> - which should be placed in the <HEAD> and
displays the title in the title bar of the web page
• <body>- defines the document’s body, contains
paragraphs, lists, hypertexts links, Images etc
• <H1> to <H6>- defines header 1 to header 6
• <P> - defines a paragraph
• <br>- insert a single line break
• <hr>- defines a horizontal rule
• <!--> defines a document comment
• Tags can have attributes.
• Attributes provide additional information about the
HTML elements on the page.
• Attributes of body tag are-
a. bgcolor- sets the background colour of the
webpage
b. background- sets an image as the background
of the webpage.
c. text- sets the text colour of the webpage.
d. leftmargin- specify the margin from left side of
the webpage in pixels.
e. topmargin- specify the margin from top of the
webpage in pixels.
Bgcolor

The bgcolor attribute sets


the background to a specified
color.

Text

Text attribute is used to change


the text colour, so as to make the
text attractive. We can specify
colour name or colour number as
value of the attribute.
Attributes always added to the start
tag.
WRITING HTML DOCS
• HTML document is made up of
elements or tags and attributes.
Background

The background attribute


sets the background to an
image. The value of this
attribute is the path of the
image you want to use.

Image file formats like jpeg,


gif, bmp etc can be used
Leftmargin

It is used to specify the


left margin of the
webpage in pixels.

Topmargin

It is used to specify the top


margin of the webpage in
pixels
Let us understand tags and
attributes through an example
<html>
<head>
<title> MY FIRST WEBPAGE</title>
</head>
<!– we write comments like this-->
<body bgcolor=“blue” text=“white” leftmargin=“50” topmargin=“5”>
<H1>Hello friends! </H1> <hr> <P>We are going to study through real
time online classes. <br> In this the sessions are conducted where the teacher
and students have to be online a t a particular time. <H3> Online teaching is
more beneficial. </H3> </P>
</body>
</html>
Lets try Hands on..
Some basic HTML tags-

• <html>- describes an HTML document


• <body>- defines the document’s body
• <H1> to <H6>- defines header 1 to header 6
• <P> - defines a paragraph
• <br>- insert a single line break
• <hr>- defines a horizontal rule
• <!--> defines a document comment
Line Breaks
<br> Tag
The <br> tag is used
when you want to end a
line, but don’t want to
start a new paragraph.
<html>
<head>
<title> My Web Page </title>
</head>
<body>
<p>
To break <br> line <br> in a <br>
paragraph, <br> use the br tag.
</p>
</body>
</html>
Horizontal rule
<hr> Tag

The <hr> tag is used to


defines a horizontal line
in a web page .
<html>
<head>
<title> My Web Page </title>
</head>
<body>
<p> Paragraph is a distinct section of
a piece of writing.</p>
<hr>
<p>"the concluding paragraph" </p>
</body>
</html>
Comments in
HTML

The comment tag is used to insert a


comment in the HTML source code. A
Comment will be ignored by the browser

You can use comments to explain


your code, which can help you
when you edit the source code at a
later date.

Example:
<!- - This is a comment - ->
Lets understand through an
example
<html>
<head>
<title> MY FIRST WEBPAGE</title>
</head>
<body>
<H1>Hello friends! </H1> <hr> <P>We are
going to study through real time online classes.
<br> In this the sessions are conducted where the
teacher and students have to be online a t a
particular time. <H3> Online teaching is more
beneficial. </H3> </P>
</body>
</html>

Lets try Hands on..


HTML Exercise

1. Give one word for the following

1) Provide additional information about elements and are attached to the elements.
2) Tag used to add section breaks.
3) An attribute of the tag used to change the background colour of the web page.
4) A line of code that is not interpreted by a browser.
5) A popular text editor used for creating HTML documents.
6) Two possible extensions of an HTML file.
7) A tag used for displaying headings in a webpage

2. Fill in the blanks

1) There are ______________ levels of headings in HTML.


2) The special character to mark the end of a container tag is___________.
3) A collection of web pages linked together in a random order is called a
_______________.
4) __________________ provide additional information about tags/elements and are
attached to the tags/elements.
3. Identify the following as a tag or an attribute.
a)BR b) ALIGN c) P d) TEXT
HTML Exercise
1. What are HTML tags?
2. Where is the text of the Title tag displayed?
3. What steps are involved in creating a simple HTML
document?
4. What is the use comment tag? Write an example of it.
5. What are the different levels of headings in HTML?
6. What happens if you forget to put a slash at the end of a
header tag?
7. What is a horizon atal rule <hr> tag and a <br> tag used
for?
8. Explain <p>tag.
9. Explain various attributes used with <body> tag.
10. Differentiate between Tags and Attributes.
11. How container tags different from empty tag. Give one
example each.

You might also like