HTML Interview Questions
HTML Interview Questions
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. More details.
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
More details.
More details.
7) Which HTML tag is used to display the data in the tabular form?
The HTML table tag is used to display data in tabular form (row * column). It also
manages the layout of the page, e.g., header section, navigation bar, body content,
footer section. Here is the list of tags used while displaying the data in the tabular form:
Tag Description
8) 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 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.
More details.
1. <!DOCTYPE html>
2. <html>
3. <body>
4. <h2>HTML Iframes example</h2>
5. <p>Use the height and width attributes to specify the size of the iframe:</p>
6. <iframe src="https://www.javatpoint.com/" height="300" width="400"></
iframe>
7. </body>
8. </html>
Syntax
o <aside>: It is used to define content aside from the content (like a sidebar)
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
o <p> tag - The <p> tag contains the text in the form of a new paragraph.
o <blockquote> tag - It is used to define a large quoted section. If you have a large
quotation, then put the entire text within <blockquote>.............</blockquote>
tag.
Example:
1. <p>
2. <span style="color:#ffffff;">
3. In this page we use span.
4. </span>
5. </p>
Syntax:
1. <iframe src="URL"></iframe>
Example:
Target to a link:
31) What are the different new form element types in HTML 5?
Following is a list of 10 frequently used new elements in HTML 5:
o Color
o Date
o Datetime-local
o Email
o Time
o Url
o Range
o Telephone
o Number
o Search
32) Is there any need to change the web browsers to support HTML5?
No. Almost all browsers (updated versions) support HTML 5. For example Chrome,
Firefox, Opera, Safari, IE.
o WebM
o Ogg
More details.
1. mp3
2. WAV
3. Ogg
Let's see the code to play mp3 file using HTML audio tag.
1. <audio controls>
2. <source src="koyal.mp3" type="audio/mpeg">
3. Your browser does not support the html audio tag.
4. </audio>
More details.
1. <p>The Taj Mahal is widely recognized as "the jewel of Muslim art in India and one
of the universally admired masterpieces of the world's heritage."</p>
2. <figure>
3. <img src="htmlpages/images/tajmahal.jpg" alt="Taj Mahal"/>
4. </figure>
More details.
1. <figure>
2. <img src="htmlpages/images/tajmahal.jpg" alt="Taj Mahal"/>
3. <figcaption>Fig.1.1 - A front view of the great Taj Mahal in Agra.</figcaption>
4. </figure>
More details.
1. <label>
2. Enter your favorite cricket player: Press any character<br />
3. <input type="text" id="favCktPlayer" list="CktPlayers">
4. <datalist id="CktPlayers">
5. <option value="Sachin Tendulkar">
6. <option value="Brian Lara">
7. <option value="Jacques Kallis">
8. <option value="Ricky Ponting">
9. <option value="Rahul Dravid">
10. </datalist>
11. </label>
More details.
1. <div id="header">
2. <h1>Monday Times</h1>
3. </div>
4. .
5. .
6. .
7. <div id="footer">
8. <p>© JavaTpoint. All rights reserved.</p>
9. </div>
1. <header>
2. <h1>Monday Times</h1>
3. </header>
4. .
5. .
6. .
7. <footer>
8. <p>© JavaTpoint. All rights reserved.</p>
9. </footer>
Menu Example
HTML 4 Menu:
1. <div id="menu">
2. <ul>
3. <li>News</li>
4. <li>Sports</li>
5. <li>Weather</li>
6. </ul>
7. </div>
HTML 5 Menu:
1. <nav>
2. <ul>
3. <li>News</li>
4. <li>Sports</li>
5. <li>Weather</li>
6. </ul>
7. </nav>
Example:
Example:
1. <input type="email">
It didn’t support audio and video without the use It supports audio and video controls with
of Flash player support. the use of <audio> and <video> tags.
Not possible to draw shapes like circles, HTML5 allows drawing shapes like circles,
rectangles, triangles, etc. rectangles, triangles, etc.
Older versions of HTML are less mobile-friendly. HTML5 language is more mobile-friendly.
The doctype declaration is too long and The doctype declaration is quite simple and
complicated. easy.
Character encoding is long and complicated. Character encoding is simple and easy.
Attributes like charset, async, and ping are Attributes of the charset, async, and ping
absent in HTML. are a part of HTML 5.
11. Are <b> and <strong> tags same? If not, then why?
HTML strong tag: The strong tag is one of the elements of HTML used in formatting
HTML texts. It is used to show the importance of the text by making it bold or
highlighting it semantically.
Syntax:
<strong> Contents... </strong>
HTML bold tag: The bold tag or <b> is also one of the formatting elements of HTML.
The text written under the <b> tag makes the text bold presentationally to draw
attention.
Syntax:
<b> Contents... </b>
The main difference between the <bold> tag & <strong> tag is that the strong tag
semantically emphasizes the important word or section of words while the bold tag is
just offset text conventionally styled in bold. Click Here to know more.
The <marquee> tag in HTML is used to create scrolling text or images on a webpage. It
can scroll horizontally from left to right or right to left, and vertically from top to bottom
or bottom to top. It includes attributes like direction to specify whether the content
moves left, right, up, or down.
### 1. `<a>`
- **Definition:** Defines a hyperlink.
- **Usage:** Used to link to another document or location.
### 2. `<abbr>`
- **Definition:** Defines an abbreviation or acronym.
- **Usage:** Provides a full description when hovered over.
### 4. `<address>`
- **Definition:** Defines contact information for the author/owner of a document.
- **Usage:** Typically used for email addresses, physical addresses, etc.
### 5. `<area>`
- **Definition:** Defines an area inside an image map.
- **Usage:** Specifies coordinates and link information.
### 6. `<article>`
- **Definition:** Defines independent, self-contained content.
- **Usage:** Suitable for blog posts, news articles, etc.
### 7. `<aside>`
- **Definition:** Defines content aside from the main content.
- **Usage:** Often used for sidebars or pull quotes.
### 8. `<audio>`
- **Definition:** Embeds sound content in a document.
- **Usage:** Supports multiple formats like MP3, Ogg, etc.
### 9. `<b>`
- **Definition:** Defines bold text.
- **Usage:** Typically used for stylistic purposes without emphasis.
These details should give you a solid understanding of each HTML tag mentioned. Let me know if you need
further clarification on any of these!
<input> types
1. <input type="button">
2. <input type="checkbox">
3. <input type="color">
4. <input type="date">
5. <input type="datetime-local">
6. <input type="email">
7. <input type="file">
8. <input type="hidden">
9. <input type="image">
10. <input type="month">
11. <input type="number">
12. <input type="password">
13. <input type="radio">
14. <input type="range">
15. <input type="reset">
16. <input type="search">
17. <input type="submit">
18. <input type="tel">
19. <input type="text">
20. <input type="time">
21. <input type="url">
22. <input type="week">