Category: All Interview Questions
-
Define z-index.
This is one of the most frequently asked CSS interview questions. Z-index is used to specify the stack order of elements that overlap each other. Its default value is zero and can take both negative and positive values. A higher z-index value is stacked above the lower index element. It takes the following values- auto,…
-
What is the difference between a class and an ID?
Class is a way of using HTML elements for styling. They are not unique and have multiple elements. Whereas ID is unique and it can be assigned to a single element.
-
What was the purpose of developing CSS?
CSS was developed to define the visual appearances of websites. It allows developers to separate the structure and content of a website that was not possible before.
-
What is meant by RGB stream?
RGB represents colors in CSS. The three streams are namely Red, Green, and Blue. The intensity of colors is represented using numbers 0 to 256. This allows CSS to have a spectrum of visible colors.
-
Explain a few advantages of CSS.
With CSS, different documents can be controlled using a single site, styles can be grouped in complex situations using selectors and grouping methods, and multiple HTML elements can have classes.
-
How can CSS be integrated into an HTML page?
There are three ways of integrating CSS into HTML: using style tags in the head section, using inline-styling, writing CSS in a separate file, and linking into the HTML page by the link tag.
-
Differentiate between CSS3 and CSS2.
The main difference between CSS3 and CSS2 is that CSS divides different sections into modules and supports many browsers. It also contains new General Sibling Combinators responsible for matching similar elements.
-
What are the elements of the CSS Box Model?
The CSS box model defines the layout and design of CSS elements. The elements are content (like text and images, padding (the area around content), border (the area around padding), and margin (the area around the border).
-
Tell us about the use of the ruleset.
The ruleset is used for the identification of selectors, which can be attached with other selectors. The two parts of a ruleset are:
-
What do you understand by the universal sector?
A universal selector is a selector that matches any element type’s name instead of selecting elements of a particular type. Example: <style> * { color: blue; font-size: 10px; } </style>