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

It alters and styles the appearance of a webpage. For example, it changes font, text color, size, spacing, etc.

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

What are the parts of the CSS syntax rule?

A
  1. Selector
  2. Declaration
  3. Property
  4. Value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the selector in a syntax?

A

The selector is the HTML element that is being styled.

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

What is the declaration in a syntax?

A

The declaration is a pair of property and value, separated by a colon. It is closed with a semicolon at the end.

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

What is a declaration block?

A

It is a structure that begins with an opening brace ( { ) and ends with a closing one ( } ).

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

What is the property in a syntax?

A

The specific aspect or characteristic of the selector that is being modified.

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

What is the value in a declaration?

A

The setting for the property, such as blue as color, 30px as font-size, or 2px solid black as border.

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

How can you type a comment in CSS?

A

By using this text: /*(insert text here)*/

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

How are colors specified?

A

With predefined color names (red, yellow, sky blue) or RGB, HEX, HSL, RGBA, and HSLA values.

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

Which property sets the background color of an element?

A

background-color

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

Which property sets the color of a text?

A

color

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

What does RGB stand for?

A

Red Green Blue

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

How does RGB function?

A

Each parameter is set from 0 to 255 (0 being the lowest intensity and 255 being the highest). The more intense a color is, the more it will be visible.

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

How can you make shades of grey with RGB?

A

By aligning the parameters to be equal.
Ex: rgb(60, 60, 60)

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

What does the A mean in RGBA and what is its function?

A

Alpha.
The function of alpha is to adjust the opacity of a color from the value of 0-1. 0 is fully transparent, and 1 is not transparent at all.

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

What is a HEX color?

A

A HEX, or hexadecimal color, is specified with #RRGGBB. The RR is red, the GG is green, and the BB is blue. They describe the components of a color.

18
Q

How are HEX colors measured?

A

The values are between 00 and ff, which is equivalent to 0 and 255 in RGB.
Ex: #ff0000 is red because red is the highest value.

19
Q

How can you make shades of grey with HEX?

A

Use equal values for all three light sources.
Example: 3c3c3c, f9f9f9

20
Q

What does HSL stand for?

A

Hue Saturation Lightness

21
Q

I don’t really care about HSL so I’m not gonna bother to elaborate further

A

Okay 👍

22
Q

Which property states the opacity of an element?

A

opacity
Tip: The value spans from 0.0 to 1.0. The lower the value, the more transparent.

23
Q

Which property specifies an image to use as a background?

A

background-image

24
Q

Which value is used to input an image as a background for the background-image property?

A

url(“…”)

25
Q

By default, a background image would repeat both horizontally and vertically. How can you prevent this from happening?

A

By using the background-repeat: no-repeat; declaration.

26
Q

Which declaration repeats a background image horizontally?

A

background-repeat: repeat-x;
Tip: X refers to the x-axis, which is horizontal.

27
Q

Which declaration repeats a background image vertically?

A

background-repeat: repeat-y;
Tip: Y refers to the y-axis, which is vertical.

28
Q

Which property specifies the position of a background image?

A

background-position

29
Q

Which property specifies whether the background image would be fixed or scroll (scroll meaning that the image goes down or up with the rest of the content)?

A

background-attachment

30
Q

Which property is used for shorthand coding for backgrounds? (by shorthand, I mean without typing the extra properties)

A

background

31
Q

Which property specifies the style of a border, or what kind of border to display?

A

border-style

32
Q

Which property defines a border’s width? And what predefined values are set for that property?

A

border-width
thin, medium, or thick

33
Q

Which order does styling a border (or anything like margins) go?

A

Clockwise
(top, right, bottom, left)

34
Q

Which property specifies a border’s color?

A

border-color

35
Q

Which property is shorthand for border-style, border-width, and border-color?

A

border

36
Q

Which property rounds borders?

A

border-radius

37
Q

Which properties sets the characteristics of a border’s sides?

A

border-right
border-left
border-bottom
border-top

38
Q

What do margins do?

A

Margins create space around elements outside of any defined border.

39
Q

Which properties specify the margin of an element’s side?

A

margin-top
margin-bottom
margin-left
margin-right

40
Q

What is the shorthand property for all margin properties?

A

margin

41
Q

Which value automatically centers an element horizontally?

A

auto

42
Q

What does padding do?

A

Padding creates space between elements and their borders.