CSS Flashcards

1
Q

What are CSS Combinators? List the 4 available

A
Additional CSS Selectors that combine with an initial CSS Selector
• Descendant selector (space)
• Child selector (>)
• Adjacent sibling selector (+)
• General sibling selector (~)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a CSS pseudo class?

A

Defines a special state of an element, for example when an element is hovered over (:)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a CSS pseudo element?

A

A CSS pseudo-element is used to style specified parts of an element, for example styling the first letter or line of an element (::)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is CSS specificity?

A

A set of rules that determine which style declarations are ultimately applied to an element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the CSS specificity hierarchy?

A
  • Inline styles
  • IDs
  • Classes, attributes and pseudo-classes
  • Elements and pseudo elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are CSS Modules?

A

CSS files that can be imported into JS files that are scoped locally as opposed to globally, by using module loaders and giving class names unique identifiers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you enforce global styling in CSS modules?

A

Using the global keyword, for example:

:global .button {

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is composition in CSS modules?

A

You can reference classes from the same file or external dependencies and get all the styles applied to the element. For example;

.background-red {
background-color: #ff0000;
}

.button {
composes: background-red;
font-size: 12px;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly