HTML Interview


Introduction

This site provides all the HTML Interview Questions And Answers For Freshers in a bunch related to each IT subject present at this site. In the current era, when students are looking for a job then the technical questions related to the programming knowledge are asked into the interview to the interview-person. To prepare the technical round of the interview, job seeker has to clear this round by answering these questions. Here all the technical questions are available in the simplest form so that students can understand easily because this site’s purpose is to provide the easy learning at one click. Here all the Latest HTML Interview Questions And Answers are available which goes up to basic level to advance level.

We know that HTML is used to develop the webpages. So companies have to check the knowledge of the web designing. If any person has the knowledge then he/she can get extra advantage to other interview person. Here all questions related to the HTML is available, user just visit to eitworld.com to get the better experience and then user feel and get the best experience.

We know that HTML is backbone of the web designing so for this purpose, technical officer have to check the basic understanding of the HTML. So they put the questions to the interview person. If he/she gives the proper answers to the officers then they can also ask code to design any form or other function. Thus we provide these types of questions to clear the interview at first click. Here we provide the HTML Interview Questions For Experienced and for basic level to advanced level.

Eitworld.com also covers the Basic HTML Interview questions and answers for freshers to fulfill the requirement of academics. So that students can take the advantage in their exam to lead the marks. We can say that eitworl.com provides the each kind of possible ways to connect the students because we provide the education at one click means all the technology related to the IT are present here. It makes easy for the students who wish to attend the interview and clear it with great success. This successful HTML tutorial is here provided which provides the great experience to the user even that user visits this site first time.

Now Let's see the list of top HTML interview questions.



1.What is HTML?

Answer: HTML stands for Hyper Text Markup Language. HTML is a web development languge which can be used for developing web pages or a complete website.

2.Which extension is used to save the HTML document?

Answer: ".html" extension is used to save the html document. Like "myfile.html".

3.What do you mean by HTML Tag?

Answer: HTML tags are keywords that are used to specify how the content of the page will be displayed.HTML tags are always enclosed within angle brackets like <tag>. There is generally a pair of every tag, one is start (or opening) tag and other is end (or closing) tag. End tag is written like </tag> .

E.g. <Name of Tag>Content </ Name of Tag>

4.What do you mean by HTML Elements?

Answer: A tag along with its content is called an HTML Element. The line given below shows an HTML Element:

<b> Example of Element </b>

5.Do all HTML tags come in pair?

Answer: No, For some tag, there is no End tag defined. Only start tag is used for them.The tags that have no End tag defined for them, their start tag is closed with a slash( / ).

E.g.<tag/>

6. What is the difference between HTML Tags and HTML Elements?

Answer: HTML Tags only include the marking of beginning and ending of an element but on the other side a HTML Element is defined by a opening tag and if that element contains other content, it ends with a closing tag.

For example <h1> and </h1> both are tags but "<h1>This is h1 tag.</h1>" is a html element.

7.What do you mean by Void HTML Element?

Answer: Html element which does not contain any content and closing tag is known as Void Html Element or Empty Html Element.Void elements can be "closed" in the opening tag like this: <hr />.<img.../>, <hr /> and <br /> etc. are the examples of Void HTML Elements.

8.Tell me about the history of HTML?

Answer: In 1980, physicist Tim Berners-Lee, who was a contractor at CERN, proposed and prototyped ENQUIRE, a system for CERN researchers to use and share documents. In 1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system. Berners-Lee specified HTML and wrote the browser and server software in the last part of 1990. In that year, Berners-Lee and CERN data systems engineer Robert Cailliau collaborated on a joint request for funding, but the project was not formally adopted by CERN. In his personal notes from 1990 he lists "some of the many areas in which hypertext is used" and puts an encyclopedia first.

9.What do you mean by <!DOCTYPE> in HTML?

Answer: <!DOCTYPE> declaration tells the browser that which version of html we are going to use.It is not an HTML tag. It can be called a declaration which must be given as the first line of the document.

10.Is <!DOCTYPE> case-sensitive?

Answer: No, <!DOCTYPE> is case- insensitive.

11.How many heading tags are present in the HTML?

Answer: There are 6 heading tags are present in HTML. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> are the HTML heading tags.<h1> presents the most important heading and <h6> presents the least important heading.

12. Does <p> tag preserve the spaces and line breaks?

Answer: No, <p> tag doesn't preserve the spaces and line breaks. It considers all consecutive spaces and line changes, as a single space. It means no matter how many time space and enter are pressed between two words; it will show only a single space between those words in output.

13.Which HTML tag is used for the line breaking?

Answer: <br> tag is used for the line breaking in HTML.

14.Which tag is used for preformatted text?

Answer: <pre> tag is used for preformatted text i.e. to preserve your spaces and line breaks. It shows the text in output as it is written in input.

15.What do you mean by HTML Attributes?

Answer: HTML attributes contain additional information about the html elements.Attributes appear inside the opening tag and their values sit inside quotation marks.

16.What do you mean by alt attribute?

Answer: The alt attribute specifies an alternative text for an image.The browser shows the alternative text when an image cannot be displayed.



17. Which tag is used to create hyperlink in the html document?

Answer:Anchor tag <a> is used to create a hyperlink in the html document.

18. Does a hyperlink apply to text only?

Answer: No, an image or a button can also be used as a hyperlink.

19. Tell me about the default states of the HTML hyperlink.

Answer: By default, there are three states of a hyperlink-

1.Unvisited link- It looks blue and underlined.

2.Visited link- It looks purple and underlined.

3.Active (focused) link- It looks red and underline.

20. Which tag is used for creating unorderd list in html document?

Answer: <ul> tag is used for creating unorderd list in html document.

21. Which tag is used for creating orderd list in html document?

Answer: <ol> tag is used for creating orderd list in html document.

22.Which tag is used for creating description list in html document?

Answer: <dl> tag is used for creating orderd list in html document.

23. How do you make a picture into a background image of a web page?

Answer: To do this you have to use the background attribute with the body tag as given below:

<body background = "html.jpg">

You can replace html.jpg with the name of your image file. This will take the picture and make it the background image of your web page.

24. What do you mean by comments?

Answer: Comments are those statements which can not be displayed by the browser, but they give the information about your html document.

25. Which tag is used to insert comments in HTML?

Answer: Comment tags <!-- and --> are used to insert comments in HTML.

26. What are the different versions of HTML?

Answer: HTML has many version as HTML, HTML+, HTML 2.0, HTML 3.2, HTML 4.01, XHTML 1.0, HTML 5, XHTML 5.

27. Which HTML tag is used to insert image in HTML document?

Answer: <img> tag is used to insert images in HTML document.

28. Which tag is used to create table in HTML document?

Answer: <table> tag is used to create table in HTML document.

29. How can you change backgroud color of web page in html?

Answer: Background color of web page in html can be changed using bgcolor attribute in <body> tag as given below:

<body bgcolor = "blue">

30. What are the types of HTML List?

Answer: There are three types of lists in HTML:

Unordered List

Ordered List

Description List

31. Which editor can be used for the HTML?

Answer: Notepad, EditPlus, Dreamviewer, WYSIWYZ editores can be used for the HTML.

32. Can I nested table within tables in HTML?

Answer: Yes you can also use one html table into another table. Here is its example:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>

<table border="4" bordercolor="gray">

<tr>

<td> <table border="4" bordercolor="gray">

<tr>

<th>Student Name</th>

<th>Roll Number</th>

</tr>

<tr>

<td>Alen</td>

<td>01</td>

</tr>

</table>

</td>

</tr>

</table>

</body>

</html>

33. Which tag is used to create row in a table?

Answer: <tr> tag is used to create a row in table.

34. Which tag is used to create column in a row?

Answer: <td> tag is used to create a column in a row.

35. Which tag is used to create a heading of a column?

Answer: <th> tag is used to create a heading of a column.

36. What do you mean by spanning?

Answer: Spanning means occupying more than one row or column by a single cell.This will be done with the help of two attributes of <th> or <td> tags. For spanning of rows, rowspan attribute is used.For spanning of columns, colspan attribute is used.

37. What do you mean by caption?

Answer: Caption is a short description of anything so that it may be understood what that thing is made for. In easy words, caption is the heading of the table.It is used just after the opening tag of table element.

38. What do you mean by image mapping?

Answer: Image mapping is making some part of the image clickable. By doing this, a single image can be used as multiple links.<map> and <area> tags are used for image mapping.

39. What is CSS?

Answer: CSS stands for Cascading Style Sheet. CSS is used to put styles in the web page elements.

40. How can you add style in HTML document?

Answer: The styles can be added to the HTML document by three methods-

Inline- When style attribute is used in each element that is to be styled, this is called Inline Style.

Internal- When style element (<style>) is used in the current html document, this is called Internal Style.

External- When an external css file (style sheet) is used for styling, this is called External style.

41. What do mean by multimedia?

Answer: Sound, music, animations, videos, movies and images etc which you can see or hear present under the term "multimedia".

42. What do you mean by HTML Form?

Answer: Form is used to take data from user and pass it on server.<form> tag is used to create a form.The
tag is used for defining the user interface elements , like command buttons , text boxes etc...

43. Tell me about HTML block elements.

Answer: Block elements usually start and end with a line break at the time of execution.<h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <pre>, <ul>, <ol>, <dl>,<table>, <hr> and <blockquote> etc are the example of HTML block elements.

44. Tell me about the HTML inline elements.

Answer: Inline elements usually displayed without a line break at the time of execution. <a>, <b>, <i>, <u>, <em>, <strong>, <td>, <img>, <li>, <small>, <ins>,<sub>, and <sup> etc are the example of HTML inline elements.

45. How many grouping tags are present in html.

Answer: There are two grouping tags in HTML: a)The <div> tag b)The <span> tag.

46. What are HTML Frames?

Answer: HTML frames are basically used for the division of the page and each section can be used for opening a separate file.To define frames in HTML you can use <frameset> tag.<frameset> tag is used in the head part of html document.

47. What is the syntax of <frameset> tag?

Answer: Here is the basic syntax of <frameset> tag:

<frameset rows="percentage/pixels" | cols="percentage/pixels">

<frame src=filename name=framename>

: : : : : : : : : : : : : : : : : : : : :

</frameset>

48. Which attribute of <frameset> tag is used to partition the HTML page into horizontal frames?

Answer: To partition HTML page in horizontal frames we have to use rows attribute of <frameset> tag.

49. Which attribute of <frameset> tag is used to partition the HTML page into vertical frames?

Answer: To partition HTML page in vertical frames we have to use cols attribute of <frameset> tag.

50. What is the use of HTML Iframes?

Answer: HTML Iframes are used for putting the another webpage into a html page.

51. Write the basic syntax of HTML Iframes?

Answer: Here is the basic syntax of <iframe> tag :

<iframe src="URL"></iframe>

52. What is WWW?

Answer: WWW is a short form of World Wide Web. It is an information system on the Internet which allows documents to be connected to other documents by hypertext links.

53. What is HTML <canvas> tag?

Answer: <canvas> tag is an element of HTML5. HTML <canvas> tag is basically used for the purpose of designing graphics on a html web page. You can draw circles, lines, rectangles, text and much more by using this html <canvas> tag. Basically a canvas is a rectangular area on an HTML page. By default, it does not contain any border and content.

54. Write the basic syntax of HTML <canvas> tag.

Answer: Here is the basic syntax of <canvas> tag :

<canvas id="HTML_Canvas" width="300" height="200" ></canvas>

55. What do you mean by HTML SVG?

Answer: SVG is a short form of Scalable Vector Graphics. Svg is used to draw graphics in HTML.<svg> tag is a container for SVG graphics.<svg> tag is an element of HTML5.You can draw circles, lines, rectangles, text and much more by using this html <svg> tag.

56. Write the syntax of HTML <svg> tag.

Answer:
<svg width="200" height="200"> <circle cx="0" cy="100" r="30" stroke="blue" stroke-width="4" fill="orange" /> </svg>

57. How can you use JavaScript with HTML?

Answer: We can use JavaScript with html by using <script> tag.

58.What do you mean by JavaScript?

Answer: Javascript is a client side scripting langugae which is used for image manipulation, form validation, and dynamic changes of content.

59. What is the use of HTML Layouts?

Answer: HTML Layout plays very important role in website designing.These Layouts give the better look to any webpage or website. HTML Layouts are very neccessary as per developer's point of view.

60.What is marquee?

Answer: A marquee allows you to put a scrolling text in a web page. To do this, place whatever text you want to appear scrolling within the <marquee> and </marquee> tags.

61. What do you mean by Marquee slide behaviour?

Answer: Marquee slide behaviour scroll the text or image from right to left once and then stay there where it is. You can again see the similar action by refreshing the page.

62. What is default action of <marquee> tag?

Answer: By default <marquee> tag scroll the text or image from right to left.Once it disappears from the left, it re-appears from the right.

63. What do you mean by Alternate Marquee behaviour?

Answer: Alternate Marquee behaviour scroll the text or image from right to left and then from left right and so on.

64. Can you scroll the image with <marquee> tag?



Answer: Yes, we can scroll the image with <marquee> tag. Here is an example of this:

<!DOCTYPE html >

<html>

<body>

<marquee direction="down"><img src="cat_run.jpg" /></marquee>

</body>

</html>

65. Do older html files work on newer browsers?

Answer: Yes, older html files are compliant to the HTML standard. Most older files work on the newer browsers, though some features may not work.

66. Tell me the names of some web-browser?

Answer: Some of the most famous web browsers are Mozilla Firefox, Internet Explorer, Google Chrome, Netscape, Opera, UC-Browser etc.

67. Which tag is used to draw horizontal ruler in a HTML webpage?

Answer: <hr> tag is used to draw horizontal ruler in a HTML webpage.

68. How can you change the size of image in HTML?

Answer: We can the change the size of image in HTML by using width and height attributes in <img> tag as given in the following example:

<!DOCTYPE html >

<html>

<body>

<p>Set Width and Height of Image</p>

<img src="html_tut.JPG" alt="HTML Tutorial" width="100px" height="100px" />

</body>

</html>

Here the image will be displayed with the size of 100px*100px.

69. How can you create email links in HTML?

Answer: We can use the email links in HTML by using mailto with the <a> tag as given below:

<a href= mailto:Email Id>any text/image</a>

70. What do you mean by target attribute?

Answer: The target attribute defines the window or frame in which the new page will be opened after clicking the hyperlink.

71. How can you open a link in a new window?

Answer: To open a link in a new window we have to use the following code:

<a href="http://www.eitworld.com/" target="_blank">Home Page:Open in new window</a>

72. How can you open a link in a default frame?

Answer: To open a link in a default frame we have to use the following code:

<a href="http://www.eitworld.com/" target="_self">Home Page:Open in the default window</a>

73. How can you change the color of default links?

Answer: We can change the color of the default links by using link attribute as given below:

<!DOCTYPE html>

<html>

<body link="green">

<a href="http://www.olx.com/" target="_blank">Home Page:www.olx.com</a>

</body>

</html>

73. How can you change the color of active links?

Answer: We can change the color of the active links by using alink attribute. See the following example:

<!DOCTYPE html>

<html>

<body alink="cyan">

<a href="http://www.olx.com/" target="_blank">Home Page:www.olx.com</a>

</body>

</html>

74. How can you change the color of visited links?

Answer: We can change the color of visited links vlink attribute. See the following example:

<!DOCTYPE html>

<html>

<body vlink="orange">

<a href="http://www.olx.com/" target="_blank">Home Page:www.olx.com</a>

</body>

</html>

75. How can you declare <!DOCTYPE> element in HTML5?

Answer: We can declare <!DOCTYPE> element in HTML5 as given below:

<!DOCTYPE html>

76. How can you declare <!DOCTYPE> element in HTML4.01?

Answer: We can declare <!DOCTYPE> element in HTML4.01 as given below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/ loose.dtd">

76. How can you declare <!DOCTYPE> element in XHTML1.0?

Answer: We can declare <!DOCTYPE> element in XHTML1.0 as given below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd">

77. What do you know about <html> tag?

Answer: he entire HTML document must be enclosed in <html> tag. This is the first tag of HTML document which indicates that the content written in it should be treated as HTML code. Therefore this is the only compulsory tag for an html document as it starts the coding.

78. Say something about <head> tag.

Answer: <head> tag contains all the elements which are included in Head Part. This part includes the title of page, css styles, JavaScripts, link of other script files or stylesheets etc. In short <head> tag is basically gives the information about the html document.

79. Say something about <body> tag.

Answer: <body> tag encloses the Body Part of the document. This part contains all the tags and the contents that will be displayed in the web page in a desired manner.

80. What is the use of <title> tag?

Answer: <title> tag is used to define the title of the page. Here is its syntax:

<title>Any Text</title>

81. How do you change the number type in the middle of a list?

Answer: The <li> tag includes two attributes-type and value. The type attribute can be used to change the numbering type for any list item. The value attribute can change the number index.

82. What do you mean by <base> tag?

Answer: <base> tag defines a base url for all relative urls. After defining the base element, all the relative paths/ urls specified further in the document, will start themselves after the url specified in base element. Here is its example:

<!DOCTYPE html>

<html>

<head>

<base href="http://www.facebook.com/" target="_blank" />

</head>

<body>

<a href="messages">Facebook Inbox</a>

</body>

</html>

83. Say something about <style> tag?

Answer: <style> tag is used to specify the css style for particular element. Here is its example:

<html>

<head>

<style>

#para {position:absolute; border:#063 solid}

</style>

</head>

<body>

<p id="para">This will have border.</p>

</body>

</html>

84. What do you mean by <script> tag?

Answer: <script> tag is used to define a client- side script. The example of client- side script is JavaScript. See the following code:

<html>

<head>

<script>

function onload()

{alert("on load executed");}

</script>

</head>

<body onLoad="onload()"></body>

</html>

85. What do you mean by <noscript> tag?

Answer: If a browser doesn't support client side scripts or a user has disabled the scripts for his browser, so <noscript> tag may be useful to ping the user that the page contains scripts that he cannot access.

86. Tell me about <meta> tag.

Answer: <meta> tag is used to define MetaData which is the information about the data of the web page.This tag will not impact the looks of the page. It can be parsed only by machine.This information may be the description of the page, author, some dates, keywords etc. This information can be used by browsers to load/ reload the page, search engines to search the page etc.

87. What is the full form of HTML?

Answer: The full form of HTML is Hyper Text Markup Language.

88. Tell me about id attribute.

Answer: The id Attribute specifies the unique id for an element.The main reason behind the use of id attribute is that if you have two or more elements of the same name in a web page than you can use the id attribute to distinguish between elements that have the same name. Here in an example that shows the use of the id attribute to style text with CSS:

<!DOCTYPE html >

<html>

<head>

<style>

#mytext{

color:blue;

}

</style>

</head>

<body>

<h1 id="mytext">www.eitworld.com</h1>

</body>

</html>

89. What is lang attribute?

Answer: The lang attribute shows the main language used in a html document.The lang attribute is used with the <html> tag.Declaration of lang attribute is important for the search engines. Here is it's example:

<!DOCTYPE html >

<html lang="en">

<body>

<h1>This document contains English language.</h1>

</body>

</html>

90. Tell me about title attribute.

Answer: The title attribute shows extra information (tooltip) about an element.

91. What is href attribute?

Answer: The href attribute basically used with the <a> tag.In Html links are defined using <a> tag and href is used for defining the address of the link.In this example, the href attribute contains the address of the home page of www.eitworld.com:

<!DOCTYPE html >

<html>

<body>

<a href="http://www.eitworld.com">eitworld.com: Home Page</a>

</body>

</html>

92. What will happen if you overlap sets of tags?

Answer: If two sets of html tags are overlapped, only the first tag will be recognized. You will recognize this problem when the text does not display properly on the browser screen.

93. How can I eliminate the extra space after a </form> tag?

Answer: HTML has no mechanism to control this. However, with CSS, you can set the margin-bottom of the form to 0. For example:

<form style="margin-bottom:0;" action=...>

You can also use a CSS style sheet to affect all the forms on a page:

form { margin-bottom: 0 ; }

94. Which tag is used to add multiline text-field in HTML document?

Answer: <textarea> tag is used for multiline text-field in HTML document.

95. What do you mean by File Upload Box control?

Answer:File Upload Box control allows user to select a file and send it to server to upload that file on your web site.File Upload Box is also known as File Select Box.This is created using the <input> element and its type attribute is set to file as given below:

<input type="file" name="fileupload" accept="any acceptable file type" />

96. What happens if you open the external CSS file in a browser?

Answer: If you try to open the external CSS file in a browser, the browser cannot open the file, because the file has a different extension. The only way to use an external CSS file is to reference it using <link/> tag within another html document.

97. What do you mean by Hidden control?

Answer: Hidden form controls are used to hide data inside the page which later on can be pushed to the server.This control hides inside the code and does not appear on the actual page.

98. Define the significance of six digits of hex-code for colors?

Answer: ommonly used hex-code is of six digits where-

1.First two digits represent the shade of red.

2.Third and fourth digits represent the shade of green.

3. Last two digits represent the shade of blue.

99. How can you add video in a html document?

Answer: Videos can be add in HTML by using <video> element.You have to simply use the given statement for this purpose:

<video width="500" height="400" controls="controls">

<source src="Hai Preet Jahan Ki Reet.mp4" type="video/mp4" />

100. Can you change the color of bullets?

Answer: The bullet color is always the same as that of the first character in the list litem. If you surround the <li> and the first character with a set of <font> tags with the color attribute set, the bullet color and the first character will be a different color from the text.