Some common CSS interview questions

Some common CSS interview questions

Top 15 CSS interview questions


1. Name some CSS frameworks.

Ans: Some of the CSS frameworks are Bootstrap, Gumby, Ukit, Semantic UI, etc.

2. What do you understand by the universal selector?

Ans: A universal selector is a selector that matches any element type’s name instead of selecting elements of a particular type.

3. What are the elements of the CSS Box Model?

Ans: The CSS box model defines the layout and design of CSS elements. The elements are content, padding,?border, and margin.

4. Explain a few advantages of CSS.

Ans: Use of CSS has some benefits like 1. Faster page speed, 2. Better User Experience, 3. Quicker Development Time, 4. Easy Formatting Changes etc.

5. What is the difference between class and ID?

Ans: 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.

6. Define z-index.

Ans: 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.

7. What are the limitations of CSS?

Ans: CSS has various limitations as a programming language that are:

1.CSS cannot perform any logical operations like if/else or for/while or +/-. 2. We can not read any files using CSS. 3. It can not interact with databases. 4. CSS can not request a web page.

8. Difference between CSS grid vs flexbox?

Ans: 1. CSS grid Layout is a two-dimensional system along with rows and columns. It is used for large-sized layouts. 2. Flexbox is a Grid layout with a one-dimensional system either within a row or a column. It is used for the components of an application.

9. What do you understand by pseudo-elements?

Ans: A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected elements. For example, it can be used to:?

  • Style the first letter, or line, of an element
  • Insert content before, or after, the content of an element

10. Tell us something about CSS3.

Ans: CSS3 is divided into modules and is supported by almost every browser. Many graphics-related characteristics are introduced in CSS3 like box-shadow, Border-radius, and flexbox. A user can create precise multiple background images using properties like background-position, background-repeat, and background-image styles.

11. What is the float property used for in CSS?

Ans: The ‘float property’ places an element on the left or the right side of its container, allowing text and other inline elements to wrap around it.

12. What is common between class and ID?

Ans: Both class and ID are used in HTML to assign a value from CSS. The ID is used as an element, whereas the class is used as a block.

13. What are the advantages of External Style Sheets?

Ans: 1. You can create classes for reusing it in many documents. 2. By using it, you can control the styles of multiple documents from one file. 3. In complex situations, you can use selectors and grouping methods to apply styles.

14. What is tweening?

Ans: 1. It is the process of generating intermediate frames between two images. 2. It gives the impression that the first image has smoothly evolved into the second one. 3. It is an important method used in all types of animations. 4. In CSS3, the Transforms module can be used to achieve tweening.

15. What are the different types of Selectors in CSS?

Ans:? CSS selectors are used to ‘find’ or ‘select’ the HTML elements you want to style. There are 6 CSS selector types-

  • CSS class selectors
  • CSS id selectors
  • CSS element selectors
  • CSS pseudo-class selectors
  • CSS attribute selectors
  • CSS global selectors

要查看或添加评论,请登录

Amit Sarker的更多文章

  • What is ChatGPT?

    What is ChatGPT?

    ChatGPT is a variant of the GPT (Generative Pre-training Transformer) language model developed by OpenAI. It is…

  • Top 15 JavaScript interview questions

    Top 15 JavaScript interview questions

    1. What is JavaScript? Ans: JavaScript is a scripting language that enables you to create dynamically updating content,…

    3 条评论
  • Some common HTML interview question

    Some common HTML interview question

    Top 15 HTML interview questions 1. What is the difference between HTML elements and tags? Ans: HTML elements…

社区洞察

其他会员也浏览了