CLASS X CH- 5 CREATING HTML DOCUMENT
Answers-
2. Answer the following questions.
a) What is HTML document and explain its structure?
HTML document is a special kind of text document used by web browsers to display text and graphics.
An HTML document has two main parts : the head and the body.
Head: The head element contains title and metadata (data about data) of a web document.
Body: The body element contains the information that you want to display on a web page.
b) What do you understand by HTML tags? Give examples.
HTML tags are the hidden keywords within a web page that defines every structure on an HTML page. Tags begin with a left‐angle bracket < and end with a right‐angle bracket >.
Example- <Head>, <body>, <p> etc.
c) Write all the tags with their functions that are required in every HTML document.
ESSENTIAL HTML TAGS
<html> tag tells web browser where the HTML document begins and ends.
<head> tag contains information about the document such a page title and links to pages that could be pre‐loaded.
<title> tag is used to give name to the document which appears in the web browser's title bar.
<body> tag contains all the matter that gets displayed in the browser window i.e. text , graphics and links.
d) What should be kept in mind while using HTML tags?
These points should be kept in mind-
1. Tags should begin with a left‐angle bracket < and end with a right‐angle bracket >.
2. Closing tags should start with a /(forward slash) after the '<' symbol and name of the tag be closed. i.e. </html>.
3. HTML tags are case‐insensitive, that is, it doesn't matter whether you type them in upper case or lower case and they mean the same.
e) What are Attributes? Explain with an example.
An attribute is used to define the property or characteristics of an HTML tag and is placed inside the tag's opening tag.
For example: < p align= “right”>, means <p> is a paragraph tag and its property(attribute) is align which has the value i.e. right, means align the paragraph to right.
f) Explain the term Element.
The complete tag including the opening tag, attribute, enclosed tag content and the closing tag is the HTML element.
g) Differentiate between Container tag and Empty tag.
Container tag refers to a tag that contains an opening as well as a closing tag. The container tag always wraps around text or graphics and comes in a set i.e. with an opening and a closing tag: <html> opening tag and </html> closing tag.
Empty tag refers to a tag that contains only an opening tag but does not need a closing tag such as <p> i.e. begin paragraph and <br> break a line.
h) Write a short note on the working of <p> paragraph tag.
Paragraph tag<p> is used to start a new paragraph in a document. It is an empty tag and needs no closing tag.
i) What is the purpose of adding comment text in HTML code?
The comment tag <!‐‐ ‐‐> is used to insert information in the source code. Anything you put between the <!‐‐ and ‐‐> tags in the body of your web page will be ignored by the browser. Comments are not visible to the user when the web page is displayed on the web browser. You can use comments to explain your code, which can help you when you edit the source code at a later stage. This is especially useful if you have a lot of coding involved to design a web page . Comments are written inside the opening and closing (<!‐ ‐ and ‐ ‐ >) tags.
j) Explain the purpose of heading tag in your words.
Heading tag<hn> is used to give the heading/ title for the document, n stands for values from 1 to 6.
k) Describe <hr> tag with its attributes and functions.
Horizontal rule tag <hr> inserts a horizontal rule from left of the screen to the right and causes a line break.
ATTRIBUTES WITH <HR> TAG-
Size- Change the thickness of horizontal line.
Width- Change the width by extending the horizontal rule across the entire Web page.
Align-The align attribute specifies the horizontal rule alignment within the web page
Color- Change the color of horizontal rule
Noshade- It produces a 3‐D gray rule, if we want to generate a solid flat 2D effect then use the noshade.
l) List all the attributes associated with <body> tag with their functions.
Background- sets an image as the background of a web page.
Bgcolor - Sets the background color of the web page.
Text - Sets the color of the text on the web page.
Link - Sets the color of the links on the web page.
Leftmargin - Used to specify the left margin of the web page.
Rightmargin - Used to specify the right margin of the web page in pixels.
m) What is the difference between the background and bgcolor attribute of the <body> tag?
Background is the attribute of the body tag used to set an image as the background for a web page.
Bgcolor attribute of the body tag specifies color at the back of the text for a web page.
n) Write any ten standard color names you are allowed to use with the bgcolor attribute of the <body> tag.
The 17 standard colors are: (write ant 10)
aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white and yellow.
Comments
Post a Comment