0% found this document useful (0 votes)
7 views1 page

Top 10 CSS Interview Questions

The document outlines the top 10 CSS interview questions and their answers, covering fundamental concepts such as CSS types, the box model, positioning, pseudo-classes, and units of measurement. It also explains specificity, media queries, and strategies for creating responsive websites. This serves as a concise guide for individuals preparing for CSS-related interviews.

Uploaded by

fekada9794
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)
7 views1 page

Top 10 CSS Interview Questions

The document outlines the top 10 CSS interview questions and their answers, covering fundamental concepts such as CSS types, the box model, positioning, pseudo-classes, and units of measurement. It also explains specificity, media queries, and strategies for creating responsive websites. This serves as a concise guide for individuals preparing for CSS-related interviews.

Uploaded by

fekada9794
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
You are on page 1/ 1

Top 10 CSS Interview Questions with Answers

1. What is CSS?

CSS stands for Cascading Style Sheets. It is used to style and layout web pages.

2. What are the different types of CSS?

There are three types: Inline CSS, Internal CSS, and External CSS.

3. What is the difference between id and class in CSS?

id is unique and used for one element, while class can be used for multiple elements.

4. What is the box model in CSS?

The box model includes margin, border, padding, and content. It describes how elements are displayed and

spaced.

5. What is the difference between relative, absolute, fixed, and sticky positioning?

Relative: Positioned relative to itself. Absolute: Relative to nearest positioned ancestor. Fixed: Relative to

browser window. Sticky: Toggles between relative and fixed.

6. What is a pseudo-class in CSS?

A pseudo-class is used to define a special state of an element, like :hover, :first-child, :last-child.

7. What is the difference between em, rem, and px?

px is absolute unit. em is relative to the parent. rem is relative to the root element.

8. What is specificity in CSS?

Specificity determines which rule is applied when multiple rules match an element. It depends on selectors

used.

9. What are media queries?

Media queries are used to apply CSS styles based on device size, resolution, or orientation.

10. How can you make a website responsive?

By using relative units, flexible layouts, and media queries to adapt to different screen sizes.

You might also like