Five Most Asked HTML Interview Questions?
Top Five Most Asked HTML Interview Questions and Answers
HTML (HyperText Markup Language) is the standard markup language used for creating web pages and web applications. Here are Five Most Asked interview questions and example answers:
Q1. What is the difference between HTML tags and elements?
A HTML tag is used to create an HTML element. The tag defines what kind of element it will be (for example <p> for paragraph) and usually occurs in an opening and closing pair like <p> and </p>. The element is the content enclosed by the opening and closing tags.
For example:
<p>This is a paragraph element</p>The <p> tag indicates the start of a paragraph. The </p> tag indicates the end of the paragraph. The paragraph text itself is the element.
Q2. How do you create a hyperlink in HTML?
A. To create a hyperlink, you use the <a> anchor tag. The destination URL goes in the href attribute, and the link text goes between the opening and closing tag:
<a href="https://www.example.com">This is a link</a>
Recommended by LinkedIn
Q3. How do you display an image in HTML?
A. To display an image, use the <img> tag. The source image URL goes in the src attribute:
<img src="image.jpg">Q4. What is the difference between HTML and CSS?
A. HTML is used for creating the structure and content of a web page, while CSS is used for styling and layout. HTML is concerned with elements like headings, paragraphs, lists, tables, etc. CSS is used to control colors, fonts, layout, backgrounds, animations, and other design aesthetics.
HTML provides structure, CSS provides presentation.
Q5. What are some new tags introduced in HTML5?
A. Some notable new tags in HTML5 include:
This covers some of the most important and frequently asked interview questions on HTML along with examples.