0% found this document useful (0 votes)
3 views2 pages

HTML CSS Interview Questions

The document contains a series of HTML and CSS interview questions along with their answers. It covers fundamental concepts such as HTML tags, differences between HTML and HTML5, CSS types, and layout techniques like Flexbox and Grid. Additionally, it explains key elements like the box model, pseudo-classes, and media queries for responsive design.

Uploaded by

v2983780
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

HTML CSS Interview Questions

The document contains a series of HTML and CSS interview questions along with their answers. It covers fundamental concepts such as HTML tags, differences between HTML and HTML5, CSS types, and layout techniques like Flexbox and Grid. Additionally, it explains key elements like the box model, pseudo-classes, and media queries for responsive design.

Uploaded by

v2983780
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML and CSS Interview Questions with Answers

HTML Questions
Q: What is HTML?
Ans: HTML (HyperText Markup Language) is the standard language used to create web pages.

Q: What are HTML tags?


Ans: Tags are keywords enclosed in angle brackets like <p>, <h1>, <div>, etc.

Q: Difference between HTML and HTML5


Ans: HTML5 supports audio, video, and canvas without plugins. It introduces new semantic tags
like <header>, <footer>, <section>.

Q: Purpose of head tag


Ans: Contains metadata, title, CSS/JS links.

Q: Doctype declaration
Ans: Tells the browser which HTML version is used. Example: <!DOCTYPE html> for HTML5.

Q: Difference between div and span


Ans: <div> is block-level, <span> is inline-level.

Q: Semantic tags
Ans: Describe meaning — <header>, <footer>, <article>, <nav>.

Q: Meta tag
Ans: Defines metadata like encoding, description, or author.

Q: Hyperlink example
Ans: <a href='[Link]

Q: Image tag
Ans: <img src='[Link]' alt='Description'>

CSS Questions
Q: What is CSS?
Ans: Used to style HTML (color, font, layout).

Q: Types of CSS
Ans: Inline, Internal, External.

Q: Syntax
Ans: selector { property: value; }

Q: Class vs ID
Ans: Class uses '.', multiple times; ID uses '#', unique.
Q: Pseudo-classes
Ans: Special states like a:hover.

Q: Z-index
Ans: Controls stacking order of elements.

Q: Box Model
Ans: Content → Padding → Border → Margin.

Q: Flexbox & Grid


Ans: Flexbox is 1D layout, Grid is 2D layout.

Q: Visibility:hidden vs Display:none
Ans: display:none removes element; visibility:hidden hides but keeps space.

Q: Media Queries
Ans: Used for responsive design: @media(max-width:600px){...}

You might also like