CSS Flashcards

(10 cards)

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 are the three ways to apply CSS to an HTML document?

A

Inline styles applied directly to HTML elements using style attribute
(e.g.<p style="color: blue; ">)
used for temporary fixes

Document-level styles defined in the <style> tag in HTML documents
(e.g. <style>)
Applied to the entire document</style></style>

External stylesheets defined in seperate .css file and linked to HTML documents using <link></link> tag
(e.g. <link></link>
Applied to multiple pages making it reusable

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

What is an element selector in CSS?

A

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

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

What is a class selector in CSS?

A

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

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

What is an ID selector in CSS?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
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
9
Q

use for style sheets

A

separate content from presentation.
allows for consistent styling across multiple pages, allows change to appearance without changing content, and easy to maintain

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

cascading

A

how styles are applied to HTML elements based on a hierarchy of priority rules (source order, specify, importance)

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