HTML Questions
HTML Questions
HTML, also termed as Hyper Text Markup Language, is a language used on the World Wide
Web. It is a common text formatting language utilized for designing and displaying web
pages.
Today, text can become more dynamic and interactive because of HTML. It can change text
into links, tables, and images. By prefixing the web page name with.html or.html, HTML
pages can be stored.
A web browser examines an HTML document from top to bottom and from left to right.
HTML tags are used to construct HTML documents and render their features. It has its own
set of attributes.
Q4. What Is the difference between HTML elements & HTML tags?
Here is a tabular comparison of HTML elements vs HTML tags to understand the differences
between the two easily:
HTML elements define the overall HTML tags are similar to keywords, as
content each tag has a distinct significance.
Example- Example-
<p> This is an example of a paragraph. <a> represents opening anchor tag </a>
</p> represents closing anchor tag
Q5. What Is HTML formatting?
HTML formatting is the method of formatting text to make it look and feel better. It employs
various tags to make text bold, italic and underlined.
For example:
The br> tag, for instance, is used to break a line, and the image> tag is used to insert an
image into a page.
Q7. Which HTML tags are used to display the data in tabular
format?
To display the data in tabular form, the following HTML tags are used:
This is one of the most common HTML interview questions for freshers, as they should know
about all types of tags used.
For example, a type attribute on an input> tag can be used to indicate whether it's a text
field, checkbox, radio button, etc.
Inside the two angled brackets, attributes are specified directly after the tag's name. They
should only be used in opening or self-closing tags. They can never appear in closing tags.
Using Attributes:
<!-- Text field -->
<input type="text" />
<!-- Checkbox -->
<input type="checkbox" />
<!-- Radio button -->
<input type="radio" value="on" />
<html>
<head>
<title>Page Title </title>
</head>
<body>Page content</body>
</html>
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>
The beginning of the comment is denoted by !-, and the end is denoted by — >. Anything in
the middle will be ignored, even if it contains valid HTML.
For Example:
<!-- This is a comment! -->
<!-- Comments spanning multiple lines -->
<!-- This part is ignored in the browser -->
Q14. What is HTML5? What are new features in it that are not
available with HTML?
HTML5 is the most recent version of the Hypertext Markup Language (HTML). HTML5's new
features include the following:
● SVG, canvas, and other virtual vector graphics are supported by HTML5.
● Vector graphics could only be employed with Flash, VML, or Silverlight in HTML.
● JavaScript can now run within a web browser, thanks to HTML5.
● HTML5 does not use SGML. It has better parsing rules for more compatibility.
● Web SQL databases are used in HTML5 to temporarily store data.
Q15. What is Semantic HTML?
Semantic HTML is a code that uses HTML markup in web pages and web apps to reinforce
semantics. It also defines the meaning of the text rather than just defining its look or form.
For Example:
<form>, <table>, and <article>, these tags clearly indicate the content.
For Example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML example</h2>
Height and width attributes specify the iframe size:
<iframe src="https://www.wscube.co/" height="200" width="300"></iframe>
</body>
</html>
You must practice such concepts before going to the job interview, so that you are well
prepared for the top HTML interview questions and answers.
The "href" attribute of the HTML anchor element is the most crucial.
Syntax:
<a href = "..........."> Link Text </a>
● Font
● bold, italics, underline
● Justification
● Color
● Superscript and subscript
You should put the text to scroll within the marquee>....../marquee> tag.
Example:
<p>
<span style="color:#ffffff;">
In this page we use span.
</span>
</p>
On the other hand, A DIV or division element is a block line, comparable to having a line
break before and after it.
For Example:
<div id="HTML">
This is <span class="Web Dev">interview</span>
</div>
Now, substitute image.gif with the name of your picture file. This will make the image the
background image of your web page.
Q27. How do you make the text on a webpage that, when clicked,
sends an email?
To do so, use the mailto command within the href tag. convert the text into a clickable link to
send an email. It is possible to write it as follows:
The HTML5 components listed below define the distinct portions of a webpage.
So, these are some of the popular and top HTML interview questions for freshers. Mastering
these questions will surely place you in a good firm as a fresher web developer.
Syntax:
<iframe src=”URL”></iframe>
Syntax:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Syntax:
<head>
<style type="text/css">
hr {color:sienna}
p {margin-left:20px}
body {background-image:url("images/back40.gif")}
</style>
</head>
Q33. What is the difference between cell spacing & cell padding?
This is yet another important thing that you must know and have in your list of HTML
interview questions and answers for experienced professionals.
The distance or gap between two cells in the same table is called cell spacing. On the other
hand, Cell Padding is defined as the gap or space between the cell's content and the cell
wall or cell border.
For Example:
<table border cellspacing=3>
<table border cellpadding=3>
<table border cellspacing=3 cellpadding=3>
Q34. Which HTML tag is used to separate sections of text?
Using the <br> tag, you can separate the lines of text.
Other tags, including <p> tag and <blockquote> tag, are also used to separate the text.
Q36. How are active links different from normal links in HTML?
Some browsers recognize it when the mouse cursor is above an active link. Others
recognize active links when the link has the attention. Those without a mouse cursor above
the link are considered normal. Blue is the default color for normal and active links.
Q38. Is there any chance that the text will appear outside of the
browser window?
The text is wrapped by default to fit within the browser window. However, if the text is part of
a table cell with a fixed width, it may expand beyond the browser window.
Please find the tabular comparison of HTML vs XHTML to know the differences better:
HTML XHTML
HTML is an abbreviation for XHTML is an abbreviation for
Hypertext Markup Language Extensible Hypertext Markup
Language
It is derived from SGML (Standard It combines both XML and HTML
Generalized Markup Language) features
HTML is a type of static Web Page XHTML is a dynamic Web Page
language language
It employs the document file format It employs markup language
HTML is all about showing data XHTML is all about describing the
data
HTML is not case sensitive XHTML is case sensitive. Each tag &
attribute should be written in
lowercase.
The graphic, caption, and contents are all referred to as a single unit in the document's main
flow. The image src and figcaption elements are part of the <figure> tag. Img src is used to
insert an image source into a document, whereas figcaption is used to change the caption of
an image.
For Example:
<figure>
<img src=”pancakes.jpg” alt=”Blueberry Pancakes”>
<figcaption>A Stack of Blueberry Pancakes</figcaption>
</figure>
For Example: If you press A, it will show the car list starting with an A letter.
<label for=”car”>Choose your car from the list:</label>
<input list=”cars” name=”car” id=”car”>
<datalist id=”cars”>
<option value=”Honda”>
<option value=”Hyundai”>
<option value=”Maruti”>
<option value=”Audi”>
<option value=”BMW”>
</datalist>
If you have been working as a web developer for some years now, then this is going to be
one of the top HTML interview questions and answers for experienced professionals.
Furthermore, if the size attribute is set to 0, the size is set to the default size of 13
characters.
Syntax:
<!DOCTYPE html>
<html>
<body>
<h2>HTML SVG example</h2>
<svg width="400" height="400">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="6" fill="red" />
</svg>
</body>
</html>
● Ordered List
● Unordered List
● Description List
● Menu List
● Directory List
The figure tag includes a photograph in a document on a web page. It manages a collection
of diagrams, images, code listings, and embedded material.
Syntax:
<p>The Taj Mahal is widely recognized as "The jewel of Muslim art in India.”</p>
<figure>
<img src="htmlpages/images/tajmahal.jpg" alt="Taj Mahal"/>
</figure>
On the other hand, physical tags instruct the browser on how to display the text contained
within the physical tag.
Examples of physical tags include:
● <b>
● <big>
● <i>
So, these are the top HTML interview questions and answers for experienced. We hope that
this set of questions is enough to crack your interview at a glance.