HTML Interview
Questions HTML
interview questions
What is HTML?
HTML stands for HyperText Markup Language and is used to design web pages using a
markup language.
What are semantic HTML elements?
Semantic elements clearly describe their meaning, like <article>, <footer>, <header>, etc.
How do you make a website
responsive?
By using meta tags for viewport and CSS media queries.
What is the purpose of the alt
attribute on images?
Classes are created using the class keyword followed by the class name and curly
braces.
What is the difference between
block and inline elements?
Block elements take up the full width, while inline elements take up only as much width as
necessary.
How do you include JavaScript in
an HTML document?
With the <script> tag, either inline or with the src attribute linking to an external JS file.
What is the use of the data-
attribute?
It allows us to store custom data on any HTML element.
What are forms used for in HTML?
To collect user input.
What is the difference between GET
and POST methods in form
submissions?
GET appends data to the URL, while POST sends data in the request body.
How do you create a hyperlink in
HTML?
Using the <a> tag with the href attribute.