TechieClues TechieClues
Updated date Jan 14, 2024
Most frequently asked CSS Interview Questions for fresher and experienced web developers. These questions and answers would help you to crack any CSS Web development interview successfuly at the first attempt
  • 1.7k
  • 0
  • 0

1. What does CSS stand for?

CSS stands for Cascading Style Sheets. It is a styling language used to design HTML elements in web designing. It is also applied in XHTML. With the presence of CSS, HTML content can be shown on screen.

2. What do you mean by CSS frameworks?

CSS frameworks are coming under pre-planned libraries. It allows easy and standards-compliant webpage styling with the presence of CSS.

3. How can you integrate CSS into web pages?

We have three effective ways to integrate CSS:

  • Inline – Style attributes play vital roles to have CSS applied HTML elements.
  • Linked – CSS can work as an external file and can be linked to different HTML elements.
  • Embedded – The head element contains code with a style element inside it.

4. What are the basic uses of CSS?

We have several uses of CSS:

  • It is delivered high accessibility,
  • It helps in page reformatting,
  • It gives site-wide consistency,
  • Separation of bandwidth.

5. Which are the modules used in the latest version of CSS?

  • Selectors
  • 2D/3D Transformations
  • Box Model
  • Animations
  • Backgrounds and Borders
  • Multiple Column Layout
  • Text Effects
  • User Interface.

6. Can we use an external style sheet?

Yes, with the presence of an external style sheet, we can write all the styling codes within a single document. We can use this document anywhere by referring to the link of that external style sheet document. Hence, if we make any changes to the external document, changes can be noticed on the webpages.

7. What is Tweening?

Tweening is a process that is used to make intermediate frames between two images that will get the appearance of the first image that develops into a 2nd image. This process is widely used in making animation.

8. Is CSS case sensitive?

CSS is not case sensitive but it uses the URLs of images and font families that are case sensitive. In the case of using an XML declaration with the presence of XHTML DOCTYPE, we will get CSS to be case-sensitive.

9. What do you mean by pseudo-elements?

Basically, pseudo-elements are used to deliver special effects to specific selectors. CSS uses these in the HTML markups. If any styling or markup is not appropriate for the document, the feature of pseudo-elements allows the extra markup without touching the original file.

10. What is the universal selector?

The universal selector can easily match with any element type instead of selecting the specific category elements.

11. Explain the float property of CSS?

The float property is used to place images to the right or left as per the requirements with performing the text wrapping all over it. These properties of elements will be used before the changes occur.

12. What is the way to use CSS selector?

With the presence of a CSS selector, we can take the content that needs to be style. Hence, it is considered as a bridge that works between the style sheet and the HTML files. “select” syntax is used as CSS selector.

13. What do you mean by gradients in CSS?

Gradients are a property of CSS that helps to show a specific transformation between two or more than two specified colors. We are having two types of gradients such as linear gradients and radial gradients.

14. Explain the uses of the box model in CSS.

The box model is involved in binding all HTML elements with including margins, border, padding, and the actual content. With the usage of the box model, we can get the authority that helps to add the borders around the elements.

15. What is the basic difference between logical tags and physical tags?

Physical tags are coming under the old version and logical tags are coming under the latest version. Logical tags are not accepted for appearance but physical tags are considered as presentational mark-up.

16. What is the basic difference between the class selector and ID selector?

The overall block is coming under the class selector whereas the ID selector has only a single element that differs from others. ID selector is unique while classes are not. An element may have both class and ID.

17. What do you mean by contextual selector?

The contextual selector is having special occurrences of an element. It acts as an individual selector. In such type of selector, the last element is only addressed. As an example: TD P TEXT {color: blue}

18. What is the work of the Z index function?

In order to place HTML elements, overlapping can occur. Z index allows in specifying the overlapping element. The number can be positive or negative and by default, the value is zero.

19. What is the command to add icons to the web page?

With the presence of the icon library such as font-awesome, we can add icons to the web pages. We need to add icon class name to any incline HTML element with using <i> or <span>. These icon libraries can be customized with the help of CSS.

20. What are the position states present in CSS?

There are four position states such as Static (default), Relative, Fixed, and Absolute.

21. Explain progressive enhancement.

Progressive enhancement focuses on the matter of the web.t delivers an extra edge to users with the latest bandwidth. It is widely used in mobile internet connection with expanding their base.

22. What do you mean by CSS counters?

CSS counters are considered as variables that can be increased by specific rules of CSS having inspector track to find out numbers of using variables.

23. Why we need to add @import on top?

@import is only present on top in order to avoid any overriding rules. We have seen in different programming languages such as Java, C, C++, C# @import is present on top.

24. What do you mean by Alternate Style Sheet?

Alternate Style Sheet helps users for choosing the style in which the page is shown using the view > page style menu. By using this sheet, any user can get multiple versions of the page according to their demands.

25. What type of media allowed by CSS?

CSS allows speech, audio, bitmap or grid media, visual and tactile media, paged or continuous media, interactive media.

26. What is the command for selecting all elements of a paragraph?

We need to use the p[lang] command to select all elements of a paragraph.

27. What is a ‘ruleset’?

Some selectors need to be attached with other selectors that will be recognized by the ruleset. It follows two steps: Selector such as R and declaration {text-indent: 12pt}

28. What do you mean by at-rule?

This is a type of rule that can be used in the entire sheet and not partially. It has precedent ‘@’ followed by 0-9 or A-Z, and a-z.

29. How can you restore the default property value by using CSS?

In CSS, we can’t get the old values back as we don’t have default values. In order to get the default property, we have to re-declare the property. 

30. What method is used in CSS as backward compatibility?

HTML sheet methods connected with CSS to provide backward compatibility.

31. What do you mean by CSS specificity?

CSS specificity is considered as a rank that can define style declaration used to an element. ‘*’ is used as a universal selector having low specificity when ID selectors are having high specificity.

32. What do you mean by inline style?

The inline style is used for adding up style into the individual HTML elements.  

33. Mention different font attributes in CSS.

CSS has different attributes such as font-variant, font-family, and font-weight, line-height of font size, font-style, caption, and icon.

34. What do you mean by RWD?

The RWD stands for Responsive Web Design. It is involved to show the designed page in any screen size based on different devices.

35. What are the basic disadvantages of CSS?

The disadvantages of CSS are –

  • It does not have any expression.
  • It doesn’t have any dynamic behavior, in order to manage pseudo-class.
  • There is no column declaration.



I specialize in creating and sharing insightful content encompassing various programming languages and technologies. My expertise extends to Python, PHP, Java, ... For more detailed information, please check out the user profile

Comments (0)

There are no comments. Be the first to comment!!!