Softricks. in

A perfect place to get complete in details

Top 10 Question asked in HTML interview

top-10-interview-question-in-html

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 <!DOCTYPE> declaration.

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 .

  1. Order list <ol>
  2. Unorder list <ul>
  3. 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 .

<a href=”https://www.google.co.in/”>Google</a>

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

<header>

<nav>

<section><article><aside>

<footer>

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.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Total
0
Share