Are you an interviewer or looking for a job? These tricky HTML interview questions and answers for freshers will help you to boost up your knowledge.
If you are just memorizing question and not understanding then you are just wasting your time. One thing which I would recommend you guys if you want to join IT industries you will have to learn lifelong. Every day you will see new technology in the market and you will have to learn for the survival.
Alright let’s begin on tricky html interview questions and answers for freshers
List of HTML interview questions and answers for freshers
1. What is HTML ?
HTML stands for Hypertext Markup Language. It is
2. Why do we use
doctype in HTML?
Is <!DOCTYPE html> is a html tag ?
No, <!DOCTYPE html> is not a HTML tag.
<!DOCTYPE html> tag basically help browser to detect the document type. Well, I guess you already know browser start reading the page from top to bottom and tag we always use in the beginning. So it helps the browser to detect the document type. It gives the instruction to the browser.
Here are the few examples of doctype.
3. Why do we use of data-* attribute?
data attribute were introduced in HTML5. With the help of data-* attribute, We can embed the custom data in the element.
Here is the good example of data attribute
<button onclick="showAttribute(this)" data-button="blue button">Button</button>
4. What is semantic HTML?
Semantic elements are those element which do their work according to name. For example <table> and <td> (table data) these elements clearly shows their job and they have some meaning. While <span> and <div> is not meaningful hence <body><li><table> etc. are semantic HTML
5. What is the major difference between span and div?
div is basically a block html tag while span is an inline html tag. Here is the example.
<html> <body style="background-color: yellow"> <div>I am div</div> <div>I am div</div> <div>I am div</div> <span>I am span</span> <span>I am span</span> <span>I am span</span> </body> </html>
6. Do all HTML tags come in a pair?
No, Because HTML has two types of tags which are empty and non-empty. Those element contains some value in between starting tag and ending know as non-empty tag for example <button></button>
and those element does not contain any value know as empty tag for example <hr> <br> <img>
7. Does a hyperlink only apply to text?
No, We can use a hyperlink on many HTML tags like images, videos, button, list, and many other HTML tags
8. What is the use of the required attribute in HTML5?
Let’s assume that you’ve created a form and you created three fields like name, address, email and you want that name and email must have some value then you will use the required attribute. With the help of required attribute user won’t be able to submit empty value.
<form action="/some_action_page.php"> Name: <input type="text" name="name" required><br> Address: <input type="text" name="address"><br> Email: <input type="text" name="email" required><br> <input type="submit"> </form>
9. How many types of heading does HTML contain?
Currently HTML have 6 types of heading which is <h1><h2><h3><h4><h5><h6>
<h1> is a big size heading mainly use for the title of the topic while <h6> is a smallest heading.
10. What is a Hyperlink and how can we create it?
HTML has a link which is known as the hyperlink. It is basically the reference to another page. You can detect a link by hovering over it and the mouse pointer will turn into a hand.
<a href="www.powertechlab.com">PowerTech Lab</a>
As you can see in the above example we are using <a> HTML tag which is used for defining the link in Website and
If you still have any doubt on HTML interview questions and answers for freshers please let me know in comments.
gadgets8 months ago
Infinity Dongle CM2 MTK 1.58 (Chinese Miracle 2)
gadgets9 months ago
Download mi account unlock tool
gadgets9 months ago
Download Samsung j200g flash file
Android8 months ago
Download Android Fastboot Reset Tool v1.2 By Mohit Kkc
Android8 months ago
TPS xiaomi tool remove any MI account
java9 months ago
How to create menu driven program in java