Coursera CSS Basics Flashcards

1
Q

What is the selector

A

Tag {

}

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

Declaration Block

A

holds information about the properties and values you are going to add to the selector.

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

Property and Value

A

Property says what we are changing and Value is what we are changing it to.

Example

h1{
color(property): blue(value);
background-color(property): grey(value);
}

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

How do you link to a CSS file?

A

<link></link>

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

Element Selectors

A

When you use an element selector, the CSS rule will apply to all elements on the webpage.

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

ID Selectors

A

use the ID Attribute of an HTML element. the ID is unique within the webpage and prefixed with a # character.
Example:
HTML
<span>New!</span>

CSS
#latest {
background-color: purple;
}

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

Class Selectors

A

Elements can be selected based on the class attribute applied to them. Can be applied to multiple elements.

HTML
<a>Go Back</a>

<p>Go Forward</p>

CSS
.navigation {
margin: 2px;
}

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

Name 5 main ways to reference color.

A
  • RGB Value
  • RGBA Value
  • HSL Value
  • Hex Value
  • Predefined color names
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

RGB Value

A

RGB is a color model that adds the colors red (R), green (G) and blue (B) together to create colors. This is based on how the human eye sees colors.

Each value is defined as a number between 0 and 255, representing the intensity of that color.

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.

p {
color: rgb(255, 0, 0);
}

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

RGBA Value

A

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

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

HSL

A

HSL is a newer color model defined as Hue (H), Saturation (S) and Lightness (L). The aim of the model is to simplify mental visualization of the color that the value represents.

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

Hex value

A

Decimal is what you use every day. Digits range from 0 to 9 before tens and hundreds are used.

Hexadecimal is similar, except it has 16 digits. This is counted as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

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

Predefined color 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
14
Q

Code for changing font

A

font-family: font name1, font name2;

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

How to set font size

A

font-size: #px;

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

Change all elements to uppercase.

A

text-transform: uppercase;

17
Q

Text Decoration is used for what.

A

text-decoration: exmample;

Underlining and strike-through.

p {
text-decoration-line: underline;
text-decoration-color: red;
text-decoration-style: solid;
text-decoration-thickness: 5px;
}

18
Q

Box Model

A

-Content
-padding
-border
-margin

19
Q

Document-Flow

A

How the computer calculates the position of HTML elements.

20
Q

Block level elements

A

A block level element will occupy the full horizontal width of its parent element and the vertical height of its content.

21
Q

Inline Elements

A

In line elements only occupy the width and height of their content. They don’t appear on a new line, hence the name in line. Therefore, multiple in line elements can form a row of elements.

22
Q

Text Alignment

A

Text alignment can be set to left, right, center and justify.

p {
text-align: center;
}