M2- Text and color in CSS Flashcards

1
Q

What are the 5 ways to reference a colour in CSS?

A

From CSS Version 3, there are five main ways to reference a color.

  • By RGB value,
  • By RGBA value,
  • By HSL value,
  • By hex value and
  • By predefined color names.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is RGB value?

A

RGB is a color model that adds the colors red (R), green (G) and blue (B) together to create colors.
Each value is defined as a number between 0 and 255, representing the intensity of that color.

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

Example of RGB

A

For example, the color red would have the RGB value of 255,0,0 since the intensity of the red color would be 100% while blue and green would be 0%.

The color black then would be 0,0,0 and the color white 255,255,255.

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

What is RGBA?

A

RGBA is an extension of RGB that add an alpha (A) channel. The alpha channel represents the opacity, or transparency, of the color.

EXAMPLE:
p {
color: rgba(255, 0, 0, 0.8);
}

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

What is HSL?

A

HSL is a newer color model defined as Hue (H), Saturation (S) and Lightness (L).

EXAMPLE:
p {
color: hsl(0, 100%, 50%);
}

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

How many digits are in hexadecimal?

A

Sixteen.
This is counted as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

For example, the color red which is RGB 255,0,0 would be written as hexadecimal #FF0000.

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

What are predefined colour names?

A

Modern web browsers support 140 predefined color names. These color names are for convenience purposes and can be mapped to equivalent hex/RGB/HSL values.

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

Which property is used to change the font in CSS?

A

font-family

EXAMPLE:
p {
font-family: “Courier New”, monospace;
}

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

What is recommended when using the font-family property?

A

Since computers vary in what fonts they have installed, it is recommended to include several fonts when using the font-family property. These are specified in a fallback order, meaning that if the first font is not available, it will check for the second font. If none of the fonts are available, it will use the browser’s default font.

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

What are the most common values for text-transform property?

A

The most commonly used values for the text-transform property are: uppercase, lowercase, capitalize and none. The default value used is none, which means the text displays as it was written in the HTML document.

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

What is the text-decoration property?

A

The text-decoration property is useful to apply additional decoration to text such as underlining and line-through (strikethrough).

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

Most common text-decoration-line values used:

A
  • Underline
  • Overline
  • Line-through
  • none
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Values for text-decoration-style property:

A
  • solid
  • double
  • dotted
  • dashed
  • wavy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly