Table of Contents Hide
- Q1. What is doctype in HTML? Is it required?
- Q2.What is the difference between inline element and block element?
- Q3. What are empty tags?
- Q4. What are the different types of list in HTML?
- Q5. Difference between id attribute and class attribute in HTML
- Q6. What does the anchor tag do?
- Q7. What is an iframe used for?
- Q8. What are semantics in HTML?
- Q9. Difference Between HTML and HTML5?
Here are the top 10 interview questions asked by the interviewer for web development.
Q1. What is doctype in HTML? Is it required?
It provides “information” about the document type to the browser. All HTML documents must start with a
In HTML 5, the declaration is simple: <!DOCTYPE html>
Q2.What is the difference between inline element and block element?
An inline element only takes up as much width as necessary. An inline element does not start on a new line.
<span> is and inline element
A block-level element always takes up the full width available. A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.
<p> & <div> are the example of block – level element
Q3. What are empty tags?
A tags that does not have an enclosing tag is called an empty tags. Empty tags are self-closing tags.
<br> & <hr> are the example of empty tags
Q4. What are the different types of list in HTML?
There are mainly three type of list in HTML .
- Order list <ol>
- Unorder list <ul>
- Description <dl>
Q5. Difference between id attribute and class attribute in HTML
The main difference between them is that “class” attribute can apply to many items whereas “id” attribute can only apply to one element at a time and are unique inside a page.
Q6. What does the anchor tag do?
The anchor tag is used to create a link on a web page. The important attribute of anchor tag is href .
Q7. What is an iframe used for?
An iframe is used to embed another document within the current HTML document. Example- to add another web page inside a web page.
<iframe src=”https://www.google.co.in” title=”google search”></iframe>
Q8. What are semantics in HTML?
A semantic element is one that the developer and browser can both understand exactly what it means.
Example of some semantics tags are
Q9. Difference Between HTML and HTML5?
A Hypertext Markup Language (HTML) is the primary language for developing web pages. HTML5 is a new version of HTML with new functionalities with markup language with Internet technologies. Language in HTML does not have support for video and audio. HTML5 supports both video and audio. Some additional attribute also added to HTML5 like date, email, etc.