PCMC: 9960935965, KOTHRUD: 9960935600

HTML INTERVIEW QUESTIONS - ASPIRE TECHSOFT

1. What is HTML?
ANS: HTML Stands for Hyper Text Markup Language, Which is used to create and design web pages. It provides the structure for web content, using elements such as headings, paragraphs, images, links, etc.
 

2. What are HTML Tags?
ANS: In HTML elements are represented by using tags anything which is surrounded by < > is known as Tags.
Eg. <h1> , <img> etc.
 

3. Types of HTML Tags?
ANS: 1. Paire tags/container tags = HTML tags that contain the closing tag along with the opening tag. Eg. <h1>___</h1> , <div>____</div>
2 . Unpaired tags /self-closing tags / empty tags = HTML tags which does not need a closing tag. Eg. <br> , <hr> .
 

4. What is an element in HTML?
ANS: Opening and closing tag along with content is known as elements.
Eg. <h1> ASPIRE TECH SOFT </h1>.
 

5. What are Semantic HTML elements?
ANS: Semantic HTML elements are elements that clearly describe their meaning in a human and machine-readable way. Eg
• <header> , <Footer> , <section> , <nav> , <main> etc.
 

6. What are the different types of lists in HTML?
ANS: 1) Ordered List (<ol>): Displays a list of items in a numbered format.
[ 1, 1), A, a), I, i ]
2) Unordered List(<ul>): Displays a list of items in a bullet format.
[ Disc , Circle, Square]
3) Description List (<dd>): Displays a list of terms with a description of each term.
 

7. What are HTML Attributes?
ANS: Attributes are the properties that can be added to an HTML tag . Eg. a <img> tag has an src attribute, which you can use to add the source from which the image should be displayed.
 

8. What is the difference between an inline element and a block-level element?
ANS: Inline Element: Inline Element stays on the same line and only takes up as much width as needed.
Ex. <span>, <a>, <strong>, <em>
Block-level Element: Block-level elements starts on new line and take up the full width available.
Ex. <div>, <p>, <h1>, <section>
 

9.What is the difference between <div> and <span> ?
ANS: 1. <div> :
• Block-level Element
• Used for grouping larger section of content.
• Start on a new line and takes up the full width.
2. <span>
• Inline element
• Used for styling smaller parts of text or content.
• Stays within the same line.
 

10. Are the HTML tags and elements the same thing?
ANS: No, HTML tags and elements are not exactly the same
TAGS
• An HTML tag is the markup enclosed in angle brackets (<>), which defines the structure or purpose of the content.
• Tags typically come in pairs: an opening tag (<p>) and a closing tag (</p>).
Ex: <h1>, <div>, <span>, <p>, etc.
Element
• An HTML element is the entire structure that includes the opening tag,
content, and closing tag.
• Some elements, like <img>, are self-closing and do not require a closing
tag.
Ex: <h1>Hello World</h1> is an element where:
• <h1> is the opening tag.
• Hello World is the content.
• </h1> is the closing tag.
 

11. What is the purpose of the <head> tag in HTML?
ANS: The <head> tag contains meta information about the document that is not displayed directly on the page. It may include elements such as <title>, <meta>, <link>, and <style> for linking external resources.
 

12. What is the difference between class and id attributes in HTML?
ANS: The id attribute is unique and should be used for one element on the page, which can be referenced using ’ # ‘ in CSS and JavaScript.
The class attribute can be assigned to more than one element so they could share common styles. It is referenced using a. in CSS.
Browse our course links: Full Stack Development Training in Pune

To Join our FREE DEMO Session: Click Here

13. What is the <iframe> tag in HTML? ANS: The <iframe> tag is used to put another HTML document within the present page. such as embedding a video, map, or another web page. It allows content from other sources to be displayed inside your webpage.
 

14. What are void Elements in HTML ?
ANS: HTML elements which do not have closing tags or do not need to be closed are Void elements. Ex <br />, <img />, <hr />, etc.
 

15. How is Cell Padding different from Cell Spacing?
ANS: Cell Spacing is the space between two consecutive cells. Whereas, Cell Padding is the space between the text of the cell and the border of the cell.
 

16. How can we combine two or more rows or columns into a single row or column in an HTML table?
ANS: HTML provides two table attributes “rowspan” and “colspan” to make a cell span multiple rows and columns respectively.
 

17. What are forms and how to create forms in HTML?
ANS: The HTML form is used to collect the user inputs. HTML provides a <form> tag to create forms. To take input from the user we use the <input> tag inside the form so collected data from the user. There are different input types like ‘button’, ‘checkbox’, ‘number’, ‘text’, ‘password’, ‘submit’ etc.
 

18. What is the purpose of the placeholder attribute in HTML forms?
ANS: The placeholder attribute provides a short hint that describes the expected value of an input field.
Ex. <input type="text" placeholder="Enter your name">
 

19. Which HTML tag is used to make text bold?
ANS: <b> tag Makes text bold.
 

20. How do you create links to different sections within the same HTML web page?
ANS: We use the <a> tag and referencing through the # symbol to create several links to different sections within the same web page.
 

21. How can we insert audio or video in a webpage?
ANS: HTML5 provides two tags: <audio> and <video> tags using which we can add the audio or video directly in the webpage.
 

22. What are self-closing tags in HTML?
ANS: Self-closing tags (also called void elements) do not have a closing tag. Ex:<img>, <br>, <hr>, <input>
 

23. What is <sup> and <sub> tags?
ANS: <sup> =Raises text above the normal text baseline.
Ex. <p>E = mc<sup>2</sup></p> , OUTPUT: E = mc²
<sub>= Lowers text below the normal text baseline.
Ex. <p>H<sub>2</sub>O is the chemical formula for water.</p>
OUTPUT: H₂O is the chemical formula for water
 

24. What is the difference between <fieldset> and <legend>?
ANS: <fieldset>: Groups related form elements together.
<legend>: Provides a caption or title for a <fieldset>.
 

25. What is the difference between target="_blank" and target="_self" in the <a> tag?
ANS: 1.target="_blank": Opens the link in a new tab or window.
2.target="_self": Opens the link in the same tab.

Browse our course links: Full Stack Development Training in Pune

To Join our FREE DEMO Session: Click Here

 

Get More Information