0% found this document useful (0 votes)
11 views4 pages

HTML CSS Must Know Questions Chanakya

The document outlines essential HTML and CSS concepts, including definitions, differences, and functionalities. Key topics include the structure of web pages, semantic elements, CSS box model, and responsive design. It also explains properties like display, position, and z-index, as well as the importance of meta tags and media queries.

Uploaded by

khopadesayali84
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)
11 views4 pages

HTML CSS Must Know Questions Chanakya

The document outlines essential HTML and CSS concepts, including definitions, differences, and functionalities. Key topics include the structure of web pages, semantic elements, CSS box model, and responsive design. It also explains properties like display, position, and z-index, as well as the importance of meta tags and media queries.

Uploaded by

khopadesayali84
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 – MUST KNOW QUESTIONS

1. What is HTML?
HTML is used to create the structure of a web page.

2. Difference between HTML and HTML5?


HTML5 supports semantic tags, audio/video, and modern web features.

3. What are semantic elements?


Elements that clearly describe their meaning.
Examples: header, footer, section, article

4. Difference between div and span?


div → block-level
span → inline-level

5. Block vs Inline elements?


Block takes full width; inline takes required width.

6. Difference between id and class?


id is unique; class can be reused.

7. What is an HTML form?


Used to collect user input.

8. Difference between GET and POST?


GET sends data in URL; POST sends data securely.

9. What is the use of alt attribute in img?


For accessibility and if image fails to load.

10. What are meta tags?


Provide information about the webpage (SEO, viewport).

CSS – MUST KNOW QUESTIONS

11. What is CSS?


CSS is used to style HTML elements.

12. What is the CSS box model?


Content + Padding + Border + Margin.

13. Margin vs Padding?


Margin is outside space; padding is inside space.
14. What is display property?
Defines how an element is displayed.

15. Difference between display:none and visibility:hidden?


display:none removes element; visibility:hidden hides but keeps space.

16. What is position property?


Used to control element placement.

17. Relative vs Absolute position?


Relative moves from itself; absolute moves from nearest positioned parent.

18. What is z-index?


Controls overlapping of elements.

19. What is responsive web design?


Website adapts to different screen sizes.

20. What are media queries?


Used to apply CSS based on screen size.

---------------------------------------------------------------------------------------------------------

1. What is HTML and why is it used?

HTML is used to create the structure of a web page.

2. Difference between HTML and HTML5?

HTML5 supports semantic tags, audio/video, and better performance.

3. What are semantic tags? Why are they important?

Semantic tags describe the meaning of content and improve SEO and readability.

4. Difference between <div> and <section>?

div is a generic container, section has meaningful content.

5. What is the difference between class and id?

Class can be reused; id must be unique.

6. Block vs Inline elements?

Block takes full width; inline takes only required width.


7. What is an iframe?

An iframe is used to embed another webpage inside a page.

8. What are meta tags?

Meta tags provide information about the webpage (SEO, viewport).

9. Difference between GET and POST?

GET shows data in URL; POST sends data securely.

10. What is the use of alt attribute in images?

It improves accessibility and shows text if image fails to load.

11. What is CSS and why is it needed?

CSS is used to style and design HTML pages.

12. Difference between inline, internal, and external CSS?

External CSS is best for large projects.

13. What is the CSS box model?

Content + Padding + Border + Margin.

14. Margin vs Padding?

Margin is outside space; padding is inside space.

15. What is display property?

Controls how elements are shown on the page.

16. Difference between display:none and visibility:hidden?

display:none removes element; visibility:hidden hides it but keeps space.

17. What is position property?

Used to control element placement.

18. Relative vs Absolute positioning?

Relative moves from itself; absolute moves from nearest parent.


19. What is z-index?

Controls overlapping order of elements.

20. What is responsive web design?

Design that works on mobile, tablet, and desktop.

21. What are media queries?

Used to apply CSS for different screen sizes.

22. Flexbox vs Grid (basic idea)?

Flexbox → one-dimensional
Grid → two-dimensional layout

23. What is overflow property?

Controls content overflow (hidden, scroll, auto).

24. What is opacity?

Controls transparency of elements.

25. What is specificity in CSS?

Rule that decides which CSS style is applied.

You might also like