CSS Flashcards

1
Q

What does CSS stand for?

A

Cascading Style Sheets

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

What is the purpose of CSS?

A

To specify styles for how HTML elements should be displayed.

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

What is the basic structure of a CSS rule?

A

selector { property: value; }

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

What are the three ways to apply CSS to an HTML document?

A

Inline styles (using the style attribute)

Document-level styles (using <style> in the head)</style>

External stylesheets (using <link></link>)

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

What is an element selector in CSS?

A

A selector that targets HTML elements by their tag name (e.g., p { color: red; })

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

What is a class selector in CSS?

A

A selector that targets elements with a specific class attribute (e.g., .menu-item { color: blue; })

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

What is an ID selector in CSS?

A

A selector that targets a unique element with a specific ID attribute (e.g., #mainheading { font-size: 24px; })

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

What is the universal selector in CSS?

A

*, which targets all elements

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

How do you combine multiple selectors in CSS?

A

Separate them with commas (e.g., h1, h2, h3 { color: green; })

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

What is the priority order for CSS rules?

A

Inline styles > document-level/external styles > browser defaults

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

How do you write a comment in CSS?

A

/* This is a comment */

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

What is the purpose of the font-family property?

A

To specify the font for text (e.g., font-family: Arial, sans-serif;)

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

What is the purpose of the margin property?

A

To specify the space outside an element’s border

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

What is the purpose of the padding property?

A

To specify the space inside an element’s border, around its content.

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

What is the text-align property used for?

A

To align text horizontally (e.g., text-align: center;).

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

What are SASS and SCSS?

A

Preprocessors that extend CSS with features like variables, nesting, and mixins, which are compiled into standard CSS