100% found this document useful (2 votes)
2K views

HTML Viva Questions

Tim Berners-Lee is known as the father of HTML. HTML is a markup language used to define the structure and layout of web pages. It allows text, images, and other content to be displayed on web pages. Some key HTML elements include headings, paragraphs, links, lists, and tables. Styles can be applied to HTML using internal or external CSS.

Uploaded by

Subha Sarah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

HTML Viva Questions

Tim Berners-Lee is known as the father of HTML. HTML is a markup language used to define the structure and layout of web pages. It allows text, images, and other content to be displayed on web pages. Some key HTML elements include headings, paragraphs, links, lists, and tables. Styles can be applied to HTML using internal or external CSS.

Uploaded by

Subha Sarah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

HTML Viva Questions

Brief History of HTML


Tim Berners-Lee is known as the father of HTML. The first available description of HTML was
a document called "HTML Tags" proposed by Tim in late 1991. The latest version of HTML is
HTML5

Features of HTML
1) It is a very easy and simple language. It can be easily understood and modified.

2) It is very easy to make an effective presentation with HTML because it has a lot of


formatting tags.

3) It is a markup language, so it provides a flexible way to design web pages along with the
text.

4) It facilitates programmers to add a link on the web pages (by html anchor tag), so it enhances
the interest of browsing of the user.

5) It is platform-independent because it can be displayed on any platform like Windows, Linux,


and Macintosh, etc.

6) It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which
makes it more attractive and interactive.

7) HTML is a case-insensitive language, which means we can use tags either in lower-case or
upper-case.

1) What is HTML?

HTML stands for Hyper Text Markup Language. It is a language of World Wide Web. It is a
standard text formatting language which is used to create and display pages on the Web. It
makes the text more interactive and dynamic. It can turn text into images, tables, links.

Hyper Text: HyperText simply means "Text within Text." A text has a link within it, is a
hypertext. HyperText is a way to link two or more web pages (HTML documents) with each
other.

Markup language: A markup language is a computer language that is used to apply layout and
formatting conventions to a text document. Markup language makes text more interactive and
dynamic. It can turn text into images, tables, links, etc.

Web Page: A web page is a document which is commonly written in HTML and translated by a
web browser. A web page can be identified by entering an URL. A Web page can be of the static
or dynamic type. 
Let's see a simple example of HTML.  

<html>  
<head>  
<title>Web page title</title>  
</head>  
<body>  
<h1>Write Your First Heading</h1>  
<p>Write Your First Paragraph.</p>  
</body>  
</html>  

<html > :This tag informs the browser that it is an HTML document. Text between html tag
describes the web document.

<head>: It should be the first element inside the <html> element, which contains the
metadata(information about the document). It must be closed before the body tag opens.

<title>: As its name suggested, it is used to add title of that HTML page which appears at the
top of the browser window. It must be placed inside the head tag and should close
immediately. (Optional)

<body> : Text between body tag describes the body content of the page that is visible to the end
user. This tag contains the main content of the HTML document.

<h1> : Text between <h1> tag describes the first level heading of the webpage.

<p> : Text between <p> tag describes the paragraph of the webpage.

2) What are Tags?

HTML tags are composed of three things: an opening tag, content and ending tag. Some tags are
unclosed tags.

HTML documents contain two things:

o content, and
o tags

When a web browser reads an HTML document, the browser reads it from top to bottom and
left to right. HTML tags are used to create HTML documents and render their properties. Each
HTML tags have different properties.

Syntax
<tag> content </tag>  
Content is placed between tags to display data on the web page.

3. What are tags and attributes in HTML?

Tags are the primary component of the HTML that defines how the content will be structured/
formatted, whereas Attributes are used along with the HTML tags to define the characteristics
of the element. For example, <p align=” center”>Interview questions</p>, in this the ‘align’ is
the attribute using which we will align the paragraph to show in the center of the view.

4) Do all HTML tags have an end tag?

No. There are some HTML tags that don't need a closing tag. For example: <image> tag, <br>
tag

5) What is formatting in HTML?

The HTML formatting is a process of format the text for a better look and feel. It uses different
tags to make text bold, italicized, underlined. 

6) How many types of heading does an HTML contain?

The HTML contains six types of headings which are defined with the <h1> to <h6> tags. Each
type of heading tag displays different text size from another. So, <h1> is the largest heading tag
and <h6> is the smallest one. For example:

<h1>Heading no. 1</h1>    
<h2>Heading no. 2</h2>    
<h3>Heading no. 3</h3>    
<h4>Heading no. 4</h4>    
<h5>Heading no. 5</h5>    
<h6>Heading no. 6</h6>   

7) How to create a hyperlink in HTML?

The HTML provides an anchor tag to create a hyperlink that links one page to another page.
These tags can appear in any of the following ways:

o Unvisited link - It is displayed, underlined and blue.


o Visited link - It is displayed, underlined and purple.
o Active link - It is displayed, underlined and red.

8) Which HTML tag is used to display the data in the tabular form?

Creating Tables in HTML


HTML table allows you to arrange data into rows and columns. They are commonly used to display tabular data like
product listings, customer's details, financial reports, and so on.

You can create a table using the <table> element. Inside the <table> element, you can use the <tr> elements to
create rows, and to create columns inside a row you can use the <td> elements.

<table> <tr> <th>No.</th> <th>Name</th> <th>Age</th> </tr> <tr> <td>1</td> <td>Peter Parker</td>
<td>16</td> </tr> <tr> <td>2</td> <td>Clark Kent</td> <td>34</td> </tr> </table>

Spanning Multiple Rows and Columns

Spanning allow you to extend table rows and columns across multiple other rows and columns.

Normally, a table cell cannot pass over into the space below or above another table cell. But, you can use
the rowspan or colspan attributes to span multiple rows or columns in a table.

<table> <tr> <th>Name</th> <th colspan="2">Phone</th> </tr> <tr> <td>John Carter</td>


<td>5550192</td> <td>5550152</td> </tr> </table>

9) What are some common lists that are used when designing a page?

There are many common lists which are used to design a page. You can choose any or a
combination of the following list types:

o Ordered list - The ordered list displays elements in numbered format. It is represented
by <ol> tag.
o Unordered list - The unordered list displays elements in bulleted format. It is
represented by <ul> tag.
o Definition list - The definition list displays elements in definition form like in dictionary.
The <dl>, <dt> and <dd> tags are used to define description list.

10) Does a hyperlink only apply to text?

No, you can use hyperlinks on text and images both. The HTML anchor tag defines a hyperlink
that links one page to another page. The "href" attribute is the most important attribute of the
HTML anchor tag.

Syntax
<a href = "..........."> Link Text </a>

11) What is a style sheet?

A style sheet is used to build a consistent, transportable, and well-designed style template. You
can add these templates on several different web pages. It describes the look and formatting of a
document written in markup language.
12) Can you create a multi-colored text on a web page?

Yes. To create a multicolor text on a web page you can use <font color ="color"> </font> for the
specific texts you want to color.

13) What is a marquee?

Marquee is used to put the scrolling text on a web page. It scrolls the image or text up, down,
left or right automatically. You should put the text which you want to scroll within the
<marquee>......</marquee> tag. 

14) How to separate a section of texts?


o <br> tag - Usually <br> tag is used to separate the line of text. It breaks the current line
and conveys the flow to the next line

15) How to make a picture of a background image of a web page?

To make a picture a background image on a web page, you should put the following tag code
after the </head> tag.

<body background = "image.gif">  

Here, replace the "image.gif" with the name of your image file which you want to display on
your web page.

16. What are the various formatting tags in HTML?

 HTML has various formatting tags:

 <b> - makes text bold


 <i> - makes text italic
 <em> - makes text italic but with added semantics importance
 <big> - increases the font size of the text by one unit
 <small> - decreases the font size of the text by one unit
 <sub> - makes the text a subscript
 <sup> - makes the text a superscript
 <del> - displays as strike out text
 <strong> - marks the text as important
 <mark> - highlights the text
 <ins> - displays as added text

17. How is Cell Padding different from Cell Spacing?

Cell Spacing is the space or gap between two consecutive cells. Whereas, Cell Padding is the
space or gap between the text/ content of the cell and the edge/ border of the cell. Please refer
to the above figure example to find the difference.
18. How can we club two or more rows or columns into a single row or column in an HTML
table?

HTML provides two table attributes “rowspan” and “colspan” to make a cell span to multiple
rows and columns respectively

19. In how many ways can we specify the CSS styles for the HTML element?

There are three ways in which we can specify the styles for HTML elements:

 Inline: Here we use the ‘style’ attribute inside the HTML element.
 Internal: Here we use the <style> tag inside the <head> tag. To apply the style we bind the
elements using ‘id’ or ‘class’ attributes.
 External: Here we use the <link> tag inside <head> tag to reference the CSS file into our HTML
code. Again the binding between elements and styles is done using ‘id’ or ‘class’ attributes.

20. What are forms and how to create forms in HTML?

The HTML form is used to collect the user inputs. HTML provides a <form> tag to create forms.
To take input from the user we use the <input> tag inside the form so that all collected user
data can be sent to the server for processing. There are different input types like ‘button’,
‘checkbox’, ‘number’, ‘text’, ‘password’, ‘submit’ etc.

<form action="/submit_data.php">
<label>Enter your name: </label>
<input type="text" name="name" />
<label>Enter Mobile number </label>
<input type="number" name="mobile_no"/>
<input type="submit" value="Submit">
</form>

21. How can we include audio or video in a webpage?

HTML5 provides two tags: <audio> and <video> tags using which we can add the audio or
video directly in the webpage

You might also like