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

Module 1 (HTML)

This document contains answers to 19 questions about HTML topics. It discusses key HTML elements, tags, attributes and their usage. Some key points covered include the difference between tags and elements, different types of lists, formatting tags, tables, hyperlinks, images and more.

Uploaded by

Pranay Bhatt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views

Module 1 (HTML)

This document contains answers to 19 questions about HTML topics. It discusses key HTML elements, tags, attributes and their usage. Some key points covered include the difference between tags and elements, different types of lists, formatting tags, tables, hyperlinks, images and more.

Uploaded by

Pranay Bhatt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Module-1 (HTML)

Q1. Are the HTML tags and elements the same thing?
Ans.No HTML tags and elements are not same thing.
HTML tags are defining the structure of html.
Html tags are enclosed with angle brackets.

<p>Paragraph tag is used to indicate the paragraph</p>

Example:<p> and </p>


Given above example is called as html tag.

Html Element is containing opening tag, content, closing tag


Example of html element
<p>This is a paragraph</p>

Q2. What are tags and attributes in HTML?


Ans. Tags and attributes are defining the structure and appearance of html.
Attributes provide additional information of html.
Tags are enclosed with angle brackets.
Attributes are always defining with opening tag.

Example of html tag


<h1>Heading Tag</h1>

Example of attributes
<a href=”www.google.com”>Click here</a>
href attribute specifies the url of page.

Q3. What are void elements in HTML?


Ans. Void element have a self-closing tag ‘</>’.
They are called ‘void’ element because it has no need to write closing tag.

Example of void elements


<img> - It is used to display image in html.
<br> - It is used to break the line.
<input> - It is used to create form input fields.
Q4. What are HTML Entities?
Ans. Html entities are used to represent symbol of copyright, rupee, registered trademark
Etc.
Html entities start with the ‘&’.

Example of html entities


&copy;
&pound;
&rupee;
&euro;

Q5. What are different types of lists in HTML?


Ans. There are three different types of lists in html
1.Order list
2.Unorder list
3.Definition list

Order list: Order list is used to define list of items.


It is marked with numbers, uppercase letter, lowercase letter
and roman numbers.

<ol>
<li>Tea</li>
<li>Coffee</li>
<li>Bourn Vita</li>
</ol>

OUTPUT:

1.Tea
2.Coffee
3.Bourn Vita

Unorder list: Unorder list defines list of items.


It is marked with bullets.

<ul>
<li>Pizza</li>
<li>Cake</li>
<li>Burger</li>
</ul>

OUTPUT:
 Pizza
 Cake
 Burger

Definition list: Definition list defines the list of terms and their definitions
In definition list ‘dt’ is define the data term and ‘dd’ defines
the data definition.

<dl>
<dt>pizza</dt>
<dd>Margherita pizza</dd>
<dt>coffee</dt>
<dd>cold coffee</dd>
<dt>Tea</dt>
<dd>ice tea</dd>
</dl>

OUTPUT:

pizza
Margherita pizza
coffee
cold coffee
Tea
ice tea

Q6. What is the ‘class’ attribute in HTML?


Ans. Class attribute is used to specify one or more CSS classes.
Multiple HTML elements can share the same class.

Syntax for class in CSS.

.class name {

}.

Example of declare class in html

<p class=” main”>This is my paragraph </p>

Declare class in CSS.


. main {
Background-color: blue;

Q7. What is the difference between the ‘id’ attribute and the ‘class’ attribute of
HTML elements?
Ans. ‘Id’ and ‘Class’ attributes are used to specify the style of html element.
‘Id’ is the unique identifier for html.
‘Class’ is the non-unique identifier for html.
‘Id’ attribute is used to identify specific element on page.

Example of ‘Id’ and ‘Class’.

<p id=” intro” class=” main”>This is my paragraph </p>

CSS.

#intro {
Font-weight: bold;
}

. main {
Background-color: blue;
}

Q8. What are the various formatting tags in HTML?


Ans. Html Provides various type of formatting tags.
It is used to format the text and structure of webpage.
Formatting tags use to set the text styles like…
{<b>Bold</b>, <i>Italic</i> <u>Underline</u>,}

Example of formatting tags:

<b>…</b>, <strong>…</strong>: It is Used to bold the text.


<u>…</u>, <ins>…</ins>: It is used to underline the text
<i>…</i>, <em>…</em>: It is used to italic the text
Q9. How is Cell Padding different from Cell Spacing?
Ans. Cell padding and Cell spacing are attributes of html table.
Cell padding is used for give space between content in the cell.
Cell spacing is used for giving space between the cells in table.

Example of cell padding and cell spacing


Cellpadding:

<html>
<head>
<title>Document</title>
</head>
<body>
<table border="1" cellpadding="50" align="center">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
</table>
</body>
</html>

Cell spacing:
<html>
<head>
<title>Document</title>
</head>
<body>
<table border="1" cellspacing="50" align="center">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
</table>
</body>
</html>
Q10. How can we club two or more rows or columns into a single row or column in an
HTML table?
Ans. In html table we can merge two or more cell using rowspan and colspan.
Rowspan is use to merge two or more row in single row.
Colspan is use to merge two or more column in single column.

<html>
<head>
</head>
<body>
<table border="1">
<tr>
<td rowspan="2">cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
</tr>
<tr>
<td>ROw1</td>
<td>Row2</td>
</tr>
</table>
</body>
</html>

<html>
<head>
</head>
<body>
<table border="1">
<tr>
<td rowspan="2">cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
</tr>
<tr>
<td>ROw1</td>
<td>Row2</td>
</tr>
</table>
</body>
</html>

Q11. What is the difference between a block-level element and an inline element?
Ans. Block level elements cover full width of container.
Block level elements include <h1>…<h6> and <div> etc..
Inline elements cover necessary width.
Inline elements include <b>…<i>…<u> etc…

Example of block-level elements and inline elements:

<html>
<head>
<title>document</title>
</head>
<body>
<h1 style=” background-color: green;” >Hello World</h1>
</body>
</html>

Output:

<html>
<head>
<title>Document</title>
<body>

<b style=” background-color: blueviolet;”>Bold</b>

</body>
</html>

Output:

Q12. How to create a Hyperlink in HTML?


Ans. In html using <a> tag we can create hyperlink in html.
<a> tag along with the ‘href’ attribute.
‘href’ specifies URL of any web page.
In <a> target has 4 attributes {_blank, _self, _parent, _top}
In <a> by default target is self.

Example of hyperlink:

<html>
<head>
<title>Document</title>
</head>
<body>
<a href=”www.google.com” target=”_blank”>click here</a>

</body>
</html>

Output:
Q13. What is the use of an iframe tag?
Ans. Iframe stands for ‘inline frame’.
Iframe syntax is <iframe src=”URL”>…</iframe>
Iframe tag allows you to display external content on your webpage.
Iframe tag include external content like {YouTube videos, google maps etc…}.

Example of iframe tag:

< html>
<head>
<title>Document</title>
</head>

<body>

<iframe width="560" height="315" src="https://www.youtube.com/embed/wjxllfY-


GgE" title="YouTube video player"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope;
picture-in-picture; web-share" allowfullscreen></iframe>
</html>

Output:
Q14. What is the use of a span tag? Explain with example?
Ans. Span tag is an inline element.
Span tag is used to group inline element and apply style to them.
the <span> tag is useful for applying styles inline elements within a larger block of
text.

Example of span tag.

<p> The <span style=background-color: yellow;>highlighted</span>

text is very important. </p>

Q15. How to insert a picture into a background image of a web page?


Ans. Using <img src=” …”> tag we can insert image in web page.

Example of inserting image on webpage:

<html>
<head>
<title>Image</title>
</head>
<body>
<img src=” E:\IMG_0171.JPG”>
</body>
</html>
Q16. How are active links different from normal links?
Ans. Normal link is non clickable link.
Normal link colour is purple.

Example of normal link and active link:

click here

Active link: Active links are known as live links or clickable links.
When link is in active state its colour is blue.

click here

Q17. What are the different tags to separate sections of text?


Ans. There are several tags to separate sections of text.

<br> This tag is used to break the line before or after line.

<p> This tag is used to define the paragraph of text. It adds line break.

<center> This tag is used to put any content in center.


<h1>…<h6> This tag is used to define heading and subheading.

<div> This tag is used for division of a webpage.

Q18. What is SVG?


Ans. SVG stands for Scalable Vector Graphics.

SVG is a one type of Image same as jpg, jpeg, etc…

It is an XML-based vector graphics.

It is used to create graphics that can be scaled without losing resolution or quality.

SVG image are based on mathematical equation that describes the shapes, lines
and curves of the graphics.

SVG image can be create and edit using vector graphics software.
Q19. What is difference between HTML and XHTML?
Ans. HTML vs xhtml: Html stands for hypertext markup language.

Xhtml stands for Extensible hypertext markup language.

Html structure are case sensitive.

In Xhtml <!DOCTYPE html> is mandatory.

In Xhtml all tags and attribute are must be written in lowercase.

Xhtml documents must be well-formed and properly validated.

Html document do not require validation.

In html possible to leave off and ending tag like</body>.

In Xhtml tags should appears in pairs.

Q20. What are logical and physical tags in HTML?


Ans. Logical tags describe the meaning or structure of the content.
Physical tags describe the presentation or appearance of the content.
Logical tags include <h1>…<h6>, <p>, <ul>
Physical tags include <b>, <strong>, <i>, <em>, <u>, <ins>

Example of physical and logical tags:

Physical tag:
<html>
<head>
<title>Image</title>
</head>
<body>
<h1>This is a First Heading</h1>
<p>This is a Paragraph</p>
</body> </html>
Logical tag:
<html>
<head>
<title>Image</title>
</head>
<body>
<i>Italic</i>
<u>Underline</u>
</body>
</html>

You might also like