HTML interview questions
There are most popular HTML interview questions asked in many companies.
1. What is HTML?
HTML refers to: high text index language. That is, an HTML document written in simple text is used to describe the structure and content of webpages with links to other pages and resources.
2. What are some of the common lists used when designing a page?
- sorted list
- Unordered list
- Definition list
- Menu list
- directory listing
3. What properties do you use?
Each tag can have additional attributes that change the way the tag works or changes. For example, a <input> tag has a type attribute, which you can use to specify a text field, a check box, a radio button, or a number of other options.
In the two angle brackets, the tags are named after attributes. They will always open tags or self-end tags to appear – they can not close tags. In a double quotation, a signal is equal to the selected value. “Take without any gaps before and after the equivalent note! Many attributes can be defined in a single note.
<! - Text Field ->
<input type = "text" />
<! - Archive ->
<input type = "checkbox" />
<! - radio button ->
<input type = "radio" value = "on" />
Each imagery is in every style – similar to style – however, most tags have their own particular ones, and those attributes are different type of tags (simply a picture molecule character paragraph tag).
4. What new features were added to HTML5?
It introduced several semantic components, which refers to the elements that express the meaning. Some of the new semantic components are <header>, <footer>, <section>, and <article>. That means they are not in simple containers, but they tell the browser more about their contents.
There are additional form element types such as “Number”, “Date”, “Calendar” and “Range”. Video and audio elements are included, and new graphic elements like <svg> and <canvas> have been added.
5. How can you create a hyperlink in HTML?
An anchor tag in HTML or <a> tag is used to create hyperlinks that create a path between two different HTML webpages.
Hyperlinks can be shown in three ways:
- Unvisited link – These links are color blue and underscore.
- visited link – These links are purple and colored in color.
- Active link – These links are red and underscore of color.
6. What is SVG element?
SVG is followed by the XML format; It has scalable vector graphics used to create vector graphics with interactive and animated support.
Resolution is independent of SVG because it does not lose its size or rearrange its quality.
7. What is HTML5 in quirks mode?
In our HTML page or in the document <! The DOCTYPE> element goes back to Quirks mode. In this mode, the HTML element is based on the browser.
So content will be displayed in accordance with the browser.
8. What is the use of combining multiple check boxes?
While checkboxes do not harm each other, they help integrate vertical boxes to integrate them. The test box buttons have their name and do not need to belong to a group. There are many other cabinets on the single web page.
9. What is Text Field Size Limits?
The default size of the text field is 13 characters. However, if the size attribute is included, the value can be less than 1. Maximum value is determined by the browser width. If the size attribute is set to 0, the size is set to the default size of 13 characters.
10. How is the text in the web page that allows you to send email if you click?
To change the text of a clickable link to send e-mail, use the mailto command in the href tag. The form is as follows:
<Href = "mailto: youremailaddress"> click to click </a>
11. What is the canvas element application?
he Canvas element helps create maps, maps, photoshoppad 2D images and helps them keep them directly in HTML5 code.
12. What are the two types of web storage in HTML5?
Two saving types of HTML5:
This only stores current session data. Data stored in session storage automatically will be automatically deleted when the browser is closed.
Local storage is another way of HTML5 web storage. Once the current storage window is closed, the data will not be automatically deleted in local storage.
13. Why use the application cache and why in HTML5?
Application cache feedback is a web application cache. It’s accessed without the need for an internet connection.
Some advantages of the use cache:
- Offline Browsing – Use the app when Internet users are offline.
- Speed – cache sources are loaded quickly
- Reduce server load – download only updated sources from the web browser server.
14. What is local storage?
There is no expiration date for local storage and the data will be available in local storage even after we close the browser.
15. There is no expiration date for local storage and the data will be available in local storage even after we close the browser.
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.
<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>
16. 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:
- Unvisited link - It is displayed, underlined and blue.
- Visited link - It is displayed, underlined and purple.
- Active link - It is displayed, underlined and red.
<a href="test.html">Click for Second Page</a>
17. What is the difference between HTML elements and tags?
HTML elements communicate to the browser to render text. When the elements are enclosed by brackets <>, they form HTML tags. Most of the time, tags come in a pair and surround content.
18. What is semantic HTML?
Semantic HTML is a coding style. It is the use of HTML markup to reinforce the semantics or meaning of the content. For example: In semantic HTML <b> </b> tag is not used for bold statement as well as <i> </i> tag is used for italic. Instead of these we use <strong></strong> and <em></em> tags.
19. How to insert a copyright symbol on a browser page?
You can insert a copyright symbol by using © or © in an HTML file.
20. 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.
21. 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.
22. What are empty elements?
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
23. What is the use of a span tag? Give one example.
The span tag is used for following things:
- For adding color on text
- For adding background on text
- Highlight any color text
In this page we use span.
24. What is the use of an iframe tag?
An iframe is used to display a web page within a web page.
<iframe src="demo_iframe.html" width="200px" height="200px"></iframe>
Target to a link:
<iframe src="http://www.javatpoint.com" name="iframe_a"></iframe>
25. What are the different new form element types in HTML 5?
Following is a list of 10 frequently used new elements in HTML 5:
26. 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.
27. Which type of video formats are supported by HTML5?
HTML 5 supports three types of video format:
28. Is audio tag supported in HTML 5?
Yes. It is used to add sound or music files on the web page. There are three supported file formats for HTML 5 audio tag.
Let's see the code to play mp3 file using HTML audio tag.
<source src="file.mp3" type="audio/mpeg">
Your browser does not support the html audio tag.
29. What is the use of figure tag in HTML 5?
The figure tag is used to add a photo in the document on the web page. It is used to handle the group of diagrams, photos, code listing with some embedded content.
<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>
<img src="htmlpages/images/tajmahal.jpg" alt="Taj Mahal"/>
30. What is button tag?
The button tag is used in HTML 5. It is used to create a clickable button within the HTML form on the web page. It is generally used to create a "submit" or "reset" button. Let's see the code to display the button.
<button name="button" type="button">Click Me</button>