0% found this document useful (0 votes)
18 views5 pages

HTML Basics: Tags and Structure Guide

Chapter 7 introduces HTML, explaining its meaning as Hyper Text Markup Language and its role in creating web pages. It covers the structure of an HTML document, including container and empty tags, as well as specific tags for headings, paragraphs, and line breaks. The chapter also provides practical examples and steps for writing, saving, and viewing HTML documents.

Uploaded by

sirikimurthy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

HTML Basics: Tags and Structure Guide

Chapter 7 introduces HTML, explaining its meaning as Hyper Text Markup Language and its role in creating web pages. It covers the structure of an HTML document, including container and empty tags, as well as specific tags for headings, paragraphs, and line breaks. The chapter also provides practical examples and steps for writing, saving, and viewing HTML documents.

Uploaded by

sirikimurthy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 7

HTML: An Introduction
Choose the correct option
1. In an HTML document, what does the letter H mean?
Hyper
2. Which of the following is the correct representation of html tags?
<..........>
3. Which of the following heading tags will display the largest heading size?
H1
4. Which of the following is created using HTML?
Webpage
5. Which of the following contents of HTML is enclosed within opening and closing tags?
Element

Fill in the blanks


1. HTML means Hyper Text Markup Language.
2. A set of pages of information on the Internet about a particular subject is called a website.
3. The language used to create web pages is known as HTML.
4. Every HTML document begins with <HTML> and ends with </HTML> tags.
5. The tags which require start and end tags are called container tags.
6. Empty tags do not require a closing tag in an HTML document.
7. An HTML document has two parts <Head> and <Body>.
8. The content written within the <Title> tag does not appear on the web page.
9. An HTML file is generally created on Notepad.
10. An HTML document is saved with the extension .html.

Write the HTML codes for the following by using superscript and subscript tags
1. (m - n)2
(m - n)<SUP>2</SUP>
2. p2 + q2 - r2
p<SUP>2</SUP> + q<SUP>2</SUP> - r<SUP>2</SUP>
3. a2b3 - c4d5
a<SUP>2</SUP>b<SUP>3</SUP> - c<SUP>4</SUP>d<SUP>5</SUP>
4. H2SO4
H<SUB>2</SUB>SO<SUB>4</SUB>
5. KNO3
KNO<SUB>3</SUB>
6. Na2CO3
Na<SUB>2</SUB>CO<SUB>3</SUB>
Subjective :
Explain the following with reference to HTML
1. Container tags
When the opening and closing tags are used in pairs in an HTML document, they are known as container tags. They are
also known as ON tag and OFF tag respectively. ON tag uses angle bracket whereas, OFF tag uses forward slash (/) after
the opening of the angle bracket (<). The contents are written within these tags in the document.
The format of HEAD container tag is as follows-
<head>
content
</head>
2. Empty tags
The tags which do not require a closing tag in an HTML document are called ‘Empty Tags'. This means that an empty tag
has only an ON tag in the document which is understood by the web browser.
For example
<br>
<hr>
3. Heading tag
HTML allows you to highlight headings in a web page by using the heading tags. They are container tags. They include
six different levels of headings which vary from <H1> to <H6>.
<Hl> tag defines the largest heading whereas, <H6> tag defines the smallest heading.
The syntax of heading tag is as follows:
<Heading tag> string of text for heading </Heading tag>
4. Body tag
Body tag contains the main HTML document that we want to display on the web page. The attributes of the body tag
(bgcolor, text etc) can be used to change the appearance of the main document.
The syntax of the body tag is as follows:
<BODY BGCOLOR="BLACK" TEXT="WHITE">
Contents of the document
</BODY>
5. Paragraph tag
The Paragraph Tag <P> is a container tag. The opening tag <P> is added at the beginning of a paragraph and the closing
tag </P> at the end of the paragraph. With the use of the paragraph tag, a single line is inserted before and after the
enclosed paragraph.
The syntax of the paragraph tag is as follows:
<P>
Paragraph 1
</P>
<P>
Paragraph 2
</P>
6. Line breaks
The line break tag <BR> is an empty tag. It works in the same way as pressing the 'Enter' key in a word processor. It
helps the user to change the line.
An example of the line break tag is as follows:
<BODY>
SACRED HEART SCHOOL <BR>
NEW COLONY <BR>
RAYAGADA<BR>
765001
</BODY>
Short Answer Questions
1. What is HTML?
Hyper Text Markup Language is a markup language used to design and display web pages or documents on the internet using
web browsers. It includes text as well as graphics. It also provides the means to link the pages on the internet. The pages
contain text as well as graphics.
HTML uses special tags or symbols while writing a piece of information. For example, the text in Italic is written as:
<I> I am using Computer Studies book </I>
Here, <I> and </I> are HTML tags. The HTML will make the text Italic as Understanding
2. What is the basic structure of an HTML document?
Every HTML document is written inside <HTML> and </HTML> tags which represent the beginning and the end of a web page,
respectively. An HTML document mainly consists of two main parts. They are:
HEAD — It contains the title of a web document and written within <HEAD> and </HEAD> tags. The tag includes <TITLE> tag
within it. The content written within the <TITLE> and </TITLE> tags does not appear on the web page.
BODY — It is the main HTML document that we want to display on the web page. It is written within <BODY> and </BODY>
tags.
The basic structure of an HTML document is as follows:
<HTML>
<HEAD>
<TITLE>...the title of the web page....
</TITLE>
</HEAD>
<BODY>....
.........the body of the webpage contemt.......
.....
</BODY>
</HTML>
3. What is meant by HTML tags?
Tags are the keywords used in an HTML document. They are marked by the angle braces (< and >) to write instructions and
define how the content will be displayed by the web browsers.
For example, <HTML>, <TITLE>, <HEAD> are tags.
4. Name the two features of an HTML document.
The two features of an HTML document are:
1. Every HTML document is written inside <HTML> and </HTML> tags which represent the beginning and the end of a web
page respectively.
2. The main document is written within <BODY> and </BODY> tags.
5. Name two web browsers which are used to view an HTML document.
Two web browsers which are used to view an HTML document are-
1. Microsoft Edge
2. Google Chrome
6. Distinguish between <P> and <BR> tags.
<P> tag <BR> tag
The paragraph tag helps to identify and separate paragraphs The line break tag works in the same way as pressing the
in an HTML document. 'Enter' key in a word processor.
The paragraph tag inserts a single line before and after the The line break tag adds blank spaces between the lines.
enclosed paragraph.
It is a container tag. It is an empty tag.
Write all the steps
1. To start writing an HTML document..
To start writing an HTML document on Notepad, follow these steps:
Step 1: Click ‘Start' followed by clicking 'Notepad' from the pop up menu.
OR
Click on shortcut icon ‘Notepad', if available on the desktop.
OR
Click on ‘Notepad' icon, if available on the taskbar. An untitled notepad will appear on the screen.
Step 2: Now, one can start writing the HTML code by using the following tags:
<HTML>
<HEAD>
<TITLE> FIRST EXPERIENCE ON HTML </TITLE>
</HEAD>
<BODY>
LEARNING HTML DOCUMENT
...................
</BODY>
</HTML>
2. To view an HTML document on a web page.
To view an HTML document on a web page, follow these steps:
Step 1: Locate the file where you have saved the file. Select the file and right-click on it.
Step 2: Select 'Open with' followed by clicking 'Microsoft Edge'.
The document saved will appear on the web browser.
3. To save an HTML document.
To save an HTML document, follow these steps:
Step 1: Click 'File' from the file menu.
Step 2: Select 'Save As' from the drop-down list.
Step 3: Enter the file name with the extension '.HTML' (say, [Link]) in the box provided.
Step 4: Click the 'Save' option.
The file [Link] will be saved and the untitled file will become SHS on Notepad.

Answer the following


1. Write an HTML document by using paragraph and line tags to format the following poem 'Two Little Dicky Birds'.
TWO LITTLE DICKY BIRDS
TWO LITTLE DICKY BIRDS
SITTING ON A WALL
ONE NAMED PETER, ONE NAMED PAUL
FLY AWAY PETER, FLY AWAY PAUL
COME BACK PETER, COME BACK PAUL
Answer
<html>
<head>
<title> Two Little Dicky Birds
</title>
</head>
<body>
<p>
TWO LITTLE DICKY BIRDS <BR>
TWO LITTLE DICKY BIRDS <BR>
SITTING ON A WALL <BR>
ONE NAMED PETER, ONE NAMED PAUL <BR>
FLY AWAY PETER, FLY AWAY PAUL <BR>
COME BACK PETER, COME BACK PAUL <BR>
</p>
</body>
</html>
2. The format of an HTML document is given below. Rearrange the format so that it can be understood by the web browser.
Answer
<HTML>
<HEAD>
<TITLE>
MY FIRST STEP TO HTML
</TITLE>
</HEAD>
<BODY>
SEARCH ENGINES ARE THE SOFTWARES ON THE WEB
WHICH HELP YOU TO LOOK FOR THE SPECIFIC
INFORMATION.
</BODY>
</HTML>

Common questions

Powered by AI

Attributes within the <BODY> tag, such as BGCOLOR and TEXT, enhance the visual presentation by defining background and text colors, thereby affecting the web page's overall look and feel. The BGCOLOR attribute sets the background color of the page, contributing to visual aesthetics and aiding in brand identity consistency . The TEXT attribute specifies the color of the text on the page, which is crucial for readability and ensuring sufficient contrast against the background color, complying with accessibility standards. These attributes allow for visual customization directly within the HTML, affecting how content is rendered to users and enhancing user engagement by aligning with visual design goals . However, it's more common to use CSS for these styles to separate content from design and improve maintainability .

Inline HTML styles can affect web design by coupling the content with presentation, leading to less maintainable and less structured code. While inline styles allow quick application of CSS properties directly within HTML elements, such as using the style attribute, they can result in redundancy and bloated HTML documents since every element must have style definitions . This increases page load times and makes global style updates cumbersome and error-prone. In contrast, external CSS separates content from design, promoting cleaner, more scalable code. External stylesheets enhance consistency across web pages, making it easier to enforce design guidelines and update styles across multiple pages simultaneously . This separation of concerns aids in better collaboration across development teams and enhances readability and flexibility of the codebase.

Heading tags in HTML, ranging from <H1> to <H6>, play a critical role in organizing content hierarchically, improving both accessibility and SEO. For web accessibility, these tags create a clear outline of the page's structure, assisting screen readers to navigate and provide context to visually impaired users. Moreover, they signal the importance of sections to SEO by allowing search engines to index the hierarchy of the information presented. An <H1> tag is typically used for the main title, reflecting the primary topic of the page, which search engines and readers recognize as the most important heading on the page . Proper and semantic use of headings makes content easier for users to scan and search engines to crawl and index, thus enhancing the page’s SEO performance .

The <TITLE> tag in an HTML document defines the title of the web page, which appears in the browser tab and in search engine results as the clickable headline. It is important for user experience by providing a concise description of the page's content, helping users identify the purpose and relevance of a page quickly . For search engine optimization (SEO), the <TITLE> tag is critical as it aids search engines in understanding the content and context of the page, which can influence page ranking . A well-optimized title can improve click-through rates from search results by making the page more appealing and relevant to potential visitors .

HTML serves as the fundamental building block for web page development, providing the structural framework needed to display content on the internet . While HTML defines the page's structure, it integrates with CSS (Cascading Style Sheets), which handles layout and stylistic elements, and JavaScript, which adds interactivity and dynamic content. This combination allows for the creation of modern, interactive web experiences by separating concerns between structure (HTML), design (CSS), and behavior (JavaScript). By adhering to web standards, these technologies ensure compatibility across various devices and browsers, forming the basis for responsive and accessible web design. Through APIs and frameworks, they also enable advanced functionality such as client-side validation, animations, and AJAX for asynchronous data loading, significantly enriching user experiences .

An HTML document must include the basic structural elements of <HTML>, <HEAD>, and <BODY> tags. The <HTML> tags define the start and end of an HTML document, functioning as the root of the HTML tree . The <HEAD> section contains metadata about the document, such as the <TITLE> tag, which specifies the title to appear in the browser's title bar and search engine results, but not on the actual web page . The <BODY> tags enclose the main content of the web page that users see, and it may include various other tags like <P>, <H1>, etc., to format and structure the content .

Saving an HTML file with the .html extension is crucial as it ensures the file is recognized by both web servers and browsers as a valid HTML document, enabling proper rendering. The .html extension denotes the file type and instructs web browsers to process the content within HTML syntax and rules . This is essential for maintaining web standards that dictate how web content is served and displayed universally, ensuring compatibility and interoperability across different platforms and devices. Not adhering to this standard can lead to issues where browsers might not render the content correctly or fail to recognize the document as a web page, hampering accessibility and user experience .

Proper semantic use of <P> and <BR> tags is crucial for structuring HTML documents coherently. The <P> tag is a container tag used to denote paragraphs, providing clear demarcation of block-level content and ensuring improved readability and organizational cohesion in HTML code . Using <BR> for line breaks provides inline text-level breaks, ideal for addresses or poems but not for separating blocks of content, which can disrupt textual flow and degrade the document’s semantic meaning . Correct usage enhances the document’s accessibility, making it easier for screen readers to convey information to visually impaired users, and improves SEO by maintaining structural integrity recognized by search engines. Poor semantics can lead to misinterpretation by both users and automated systems, negatively impacting user experience and search ranking .

Container tags in HTML require both an opening and a closing tag, meaning content is placed between pairs such as <P> and </P> . This is used for elements that contain content or other tags. In contrast, empty tags do not require a closing tag and are used for elements that do not enclose any content, such as <BR> and <HR> . These differences are important because they affect how content is structured and displayed in a web page. Container tags allow for organized nesting and the enclosure of additional attributes or styles, whereas empty tags provide functionality without enclosing additional data, making the HTML code cleaner and potentially reducing processing time .

Using <SUP> (superscript) and <SUB> (subscript) tags in HTML enhances the readability of mathematical and chemical formulas by accurately representing the notational style common in scholarly and scientific contexts, such as exponents or chemical indices. This leads to a clearer presentation, visually aligning content with conventional standards, which improves comprehension and communication . For example, formulas like (m - n)<SUP>2</SUP> or H<SUB>2</SUB>SO<SUB>4</SUB> are displayed as they are universally recognized, making the content more accessible to users familiar with these formats. This usage facilitates effective learning and interpretation of content, vital for educational and scientific applications .

You might also like