Web Designing and Publishing
HTML Question & Answer
Question : 1
What is HTML?
Answer :
HTML is short for Hyper Text Markup Language and is the language of the World Wide Web. It is the standard text formatting language used for creating and displaying pages on the Web. This means that an HTML document, written in plain text, is used to describe the structure and content of web pages, with links to other pages.
HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
- The <!DOCTYPE html> declaration defines this document to be HTML
- The <html> element is the root element of an HTML page
- The <head> element contains meta information about the document
- The <title> element specifies a title for the document
- The <body> element contains the visible page content
- The <h1> element defines a large heading
- The <p> element defines a paragraph
Question : 2
What are attributes and how do you use them?
Answer :
Each tag can also have additional attributes, which change the way the tag is display.
For example, an <input> tag has a type attribute, which you can use to specify whether it’s a text field, checkbox, radio button or one of many more options.
Attributes are specified directly after the name off the tag, inside the two angled brackets. They should only ever appear in opening tags or in self-closing tags-they can never be in closing tags.
They are followed by an equals sign= and the chosen value in double quotes “. Do not include any spaces before and after the equals sign. Multiple attributes can be defined on a single tag, separated by a space.
<!—Text field -->
<input type=”text”/>
<!—Checkbox -- >
<input type=”checkbox”/>
<!—Radio button -- >
<input type =”radio” value=”on”/>
Question : 3
What new features were added to HTML5?
Answer :
It introduced a number of semantic elements, which is to say elements that convey meaning some of the new semantic elements are <header>,<section>,and <article>.They are semantic in that they are not just simple containers, but they tell the browser more about their contents.
There are additional form element types, like “number”, date”, “calendar” and “range”. Video And audio elements have also been added, as well as new graphic elements, such as <svg> and <Canvas>.
Question : 4
What is cell spacing and cell Padding?
Answer :
Cell spacing is referred to space/gap between the two cells of the same table.
Cell Padding is referred to the gap/space between the content of the cell and cell wall or
Cell border.
Example:-
<table border cell spacing=”3”>
<table border cell padding=”3”>
<table border cell spacing=”3” cell padding=”3”>
Question : 5
Write the HTML code to create the table which is given below:
Answer :
<html>
<head>
</head>
<body>
<table border=”3”>
<tr align=”center” valign=middle”>
<th>INDO</th>
<th>Name</th>
<th>class</th>
<th>DOB</th>
</tr>
<tr align=”left” valign=”bottom”>
<td>110</td>
<td>Manju</td>
<td>4-Nov-1993</td>
</tr>
</table>
</body>
</html>
Question : 6
Create HTML document that display the text “O Level Exam” in five different color.
Answer :
<p><font color="red"> O Level Exam</font></p>
<p><font color="green"> O Level Exam</font></p>
<p><font color="blue"> O Level Exam</font></p>
<p><font color="orange"> O Level Exam</font></p>
<p><font color="yellow"> O Level Exam</font></p>
Question : 7
What are the common attribute of <img > tag?
Answer :
The Common Attribute of <img> Tags are:
src: to set the source of image it can be a local system path or URL
width: to set the width of image it can be a number of pixels or in percentage
height: to set the height of image it can be a number of pixels or percentage
border: to set the border of image
alt: to set the alternate text of image
title : to define the title of image which display when mouse is hover on image
hspace: to set the horizontal (left and right) space from image
vspace: to set the space (margin) from top and bottom (i.e. vertical space) in image
Example:
<img src="logo.png" width="200px" height="100px" hspace="40px" vspace="20px" alt="infomax logo" title="infomax academy"/>
Question : 8
What is HTML?
Answer :
HTML is short for HyperText Markup Language and is the language of the Word Wide Web. It is the standard text formatting language used for creating and displaying pages on the Web. this means that an HTML document, written in plain text, is used to describe the structure and content of web pages, with links to other pages.
Question : 9
What is the difference between HTML elements and tags?
Answer :
Elements: Each part of an web page, such as a paragraph, an image, a link or anything else you can interact with, is an elements. Each type of element has its own behavior. you can links, or type in text boxes.
Tags: An HTML document is a simple, plain text document, which we are able to open with any text editor on our computer. When we open one, we will see the document is made up of tags, which are keywords surrounded by angled brackets, each of which describes an HTML element. Here, we can see HTML tags telling the browser how to render the text element inside:
<p> This text is surrounded by HTML tags!</p>
Most tags have opening and closing tags. The opening tag is written with the tag name in angled brackets, like <tagname> whereas the closing tag adds a forward slash: </tagname>. Anything between these opening and closing tags is considered to be contents of that tag.
Question : 10
What are attributes and how do you use them?
Answer :
Each tag can also have additional attributes, which change the way the tag is display. For example, an <input> tag has a type attribute, which you can use to specify whether it's a text field, checkbox, radio button or one of many more options.
Attributes are specified directly after the name of the tag, inside the two angled brackets. They should only ever appear in opening tags or in self-closing tags- they can never be in closing tags. They are followed by an equals sign = and the chosen value in double quotes". Do not include any spaces before and after the equals sign. Multiple attributes can be defined on a single tag, separated by a space.
<!-- Text field -->
<input type="text"/>
<!--Checkbox-->
<input type="checkbox"/>
<!-- Radio button -->
<input type="radio" value="on"/>
Question : 11
What new features were added to HTML5?
Answer :
It introduced a number of semantic elements, which is to say elements that convey meaning. Some of the new semantic elements are <header>, <footer> and <article>. They are semantic in that they are not just simple containers, but they tell the browser more about their contents.
There are additional from element types, like "number", "date", "calendar" and "range". Video and audio elements have also been added, as well as new graphic elements, such as <svg> and <canvas>.
Question : 12
What is Cell Spacing and Cell Padding?
Answer :
Cell Spacing is referred to space /gap between the two cells of the same table.
Cell Padding is referred to the gap / space between the content of the cell and cell wall or Cell border.
Example:
<table border cellspacing="3">
<table border cellpadding="3">
<table border cellspacing="3" cellpadding="3">
Question : 13
Explain list elements in HTML.
Answer :
The list elements in HTML are:
Ordered List (<ol>): An Ordered List or o1 tag are the list which will list the items in an ordered way, i.e. numbered or alphabetically.
Unordered List (<ul>): An Unordered List or ul tag is the list which will list the items in an unordered war, i.e. in bulleted format or in any other format.
Definition List (<dl>): A definition List or dl tag arranges the items in the way in which they are arranged in a dictionary.
Question : 14
What is the user of <Body> tag in HTML code? Write any two attribute used with this tab.
Answer :
The <body> tag contains the contents of our document including background color, text, color, link color and page margins. Also, various mark-up elements are allowed within the body to indicate headings, paragraphs, list, hypertext and so on. These are described in the <body> documents. The two attributes are: background and bgcolor.