CSS Flashcards

CSS (38 cards)

1
Q

What are the three parts of a CSS rule?

A

Selector, Declaration Block, Declaration

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

What is a CSS Declaration?

A

A CSS property followed by a colon (:) and the property value.

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

What is a CSS Selector?

A

The HTML elements to which the specific style rule applies.

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

What is a CSS Declaration Block?

A

One or more declarations separated by semicolons (;).

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

Is it a good practice to place each declaration on a separate line and to add a semicolon to the end of each declaration block?

A

True

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

What are the valid ways CSS can be implemented?

A

Embedded, External, Inline

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

Does an inline style use a selector?

A

False

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

Does an inline style use curly braces {}?

A

False

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

Should a website use an external stylesheet for styles that apply to all web pages?

A

True

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

Can inline styles be used with embedded and external stylesheets?

A

True

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

Do CSS style declarations override the default browser style declarations?

A

True

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

What is CSS inheritance?

A

When style declarations from a parent element cascade down and are applied to any child elements.

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

Can the !important rule be used to override other declarations and disregard specificity?

A

True

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

What are the valid CSS selector types?

A

Class, Descendant, Element, ID, Pseudo-Class

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

Are class names in HTML separated by commas?

A

False, they are separated by spaces.

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

What are some valid pseudo-class selectors?

A

:empty, :enabled, :hover, :lang(language)

17
Q

Do pseudo-class selectors match elements based on user behavior or meta-information about HTML elements?

18
Q

What are the different types of CSS selectors and their functions?

A

Element Selector: Selects HTML elements by name.

Class Selector: Uses . to select elements with a class.

Descendant Selector: Selects elements inside another element.

ID Selector: Uses # to select elements by ID.

Pseudo-Class Selector: Uses : to apply styles based on a state.

19
Q

What is the universal selector in CSS?

20
Q

What is the term for combining multiple selectors?

A

Multiple Selector

21
Q

What is the child selector symbol in CSS?

22
Q

What is the general sibling selector symbol in CSS?

23
Q

What is the adjacent sibling selector symbol in CSS?

24
Q

What are the different CSS combinators?

A

Adjacent Sibling, Child, Descendant, General Sibling

25
How is an attribute selector specified?
With an attribute name and optional value comparison enclosed in square brackets ([ ]).
26
Does the pseudo-element selector (::) match parts of elements?
True
27
What does the CSS color property control?
Text color
28
What are valid ways to specify color in CSS?
Hexadecimal Color, HSL Color Value, RGB Color Value, RGBA Color Value
29
What are the valid values for the float property?
Left, None, Right
30
Do float and clear properties control how text flows around elements, similar to magazine layouts?
True
31
Does the inline-block property display content as a block element but format it as an inline element?
True
32
Are CSS variables defined with //?
False, they are defined with --.
33
Where are CSS variables declared for global scope?
:root
34
What is the syntax to declare a CSS variable?
--section-color: black;
35
How do you use a CSS variable?
color: var(--section-color);
36
What are the absolute length units in CSS?
cm, in, mm, pc, pt, px
37
What are the components of the CSS box model?
Border, Content, Margin, Padding
38
What is the abbreviation for pixels in CSS?
px