CSS Flashcards

1
Q

Principle of inheritance in CSS/explain cascading style sheets.

A

Lower level styling code overrides higher level styling code. So the overall style of a HTML element is determined through a cascade of style sheet applications.

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

List and explain the 3 levels of style sheets from least important to most important.

A

External - can apply to the bodies of any number of documents
Document Level - apply to the body of the document it is in
Inline - apply to a single HTML element

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

How is an external style sheet linked? (Code)

A

<link></link>

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

What are the three components of each CSS rule?

A

selector, property and value.

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

What is the order of each value in the font property?

A

font: weight size 1st font, 2nd font;

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

Pixels vs Points vs Ems vs Rem vs Percent

A

Pixels = one dot on computer screen
Points = 1 / 72 of an inch
Ems = 1em = default font size in browser
Rem = 1rem = default font size of html element
Percent = % relative to the container

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

Possible uses of text-transform? (code)

A

text-transform: uppercase;
text-transform: lowercase;
text-transform: capitalize;

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

Explain use of text-shadow? (code)

A

text-shadow: height-of-shadow width-of-shadow blur radius color

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

Explain use of text-decoration? (code)

A

text-decoration-line: underline, overline, line-through
text-decoration-color:
text-decoration-style: solid, wavy, dotted, dashed, double
text-decoration-thickness:

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

How is a color specified in HEX?

A

Colorcode

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

Explain list-style-type? (code) What should it be applied to?

A

list-style-type: decimal, upper-alpha, lower-alpha, upper-roman, lower-roman

Overall list container

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

Explain the four types of simple selectors.

A

elementname
.classname
#idname
* (universal selector, selects all)

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

Explain the four combinator selectors

A

Space - Parent Child (selects all elements that are descendants of a specified element)
Child Selector- Parent>Child (selects all elements that are the children of a specified element)
Adjacent Sibling Detector - Element+Element (Selects the element directly after the first element)
General Sibling Selector - Element~Element (Selects all elements at the same level as named element)

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

Explain the seven [attribute] selectors.

A

[attribute] - Selects elements with a specified attribute
[attribute=value] - Selects elements with a specified attribute & value
[attribute~=”string”] - Selects elements with an attribute value containing specific words
[attribute|=value] - Select elements with an specified attribute whose value can be exactly the specified value or the specified value followed by a hypen.
[attribute^=value] - Select elements with the specified attribute, whose value starts with a specified value.
[attribute$=value] - Select elements with the specified attribute, whose value ends with a specified value.
[attribute*=value] - Select elements with the specified attribute value contains a specified value.

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

List the four tree-structural pseudo-class selectors.

A

:root
:first-child
:last-child
:nth-child(n)

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

Explain the three location pseudo-class selectors.

A

:link (default style for links)
:visited (style for links that have been clicked on)
:target (selects anchors in the current URL)

17
Q

Explain the six user-action and input pseudo-class selectors.

A

:hover
:active
:focus (an input that is being typed in)
:autofill(selects input that has been autofilled)
:checked(selects checkbox, radio etc that is on)
:required(selects form elements with required attribute)

18
Q

Explain the six pseudo-elements selectors

A

::after (Insert something after the content of each element of the named type)
::before (Insert something before the content of each element of the named type)
::first-letter
::first-line
::marker Selects the marker of list items
::selection Selects the portion of an element selected by the user.

19
Q

Order of styles in border. What are the border styles?

A

border: size style color

border-style: none, hidden, dotted, dashed, solid, double

20
Q

What function will push the rows and columns of a table together with no spaces?

A

border-collapse

21
Q

List the four parts of the cascade algorithm from least to most important.

A

Initial & Inherited Properties (default)
Order of Appearance (what code comes last)
Selector Specificity
Origin & Importance

22
Q

List the order of importance for origin starting with the least important.

A

User Agent Styles (browser)
User
Author

23
Q

Explain five selector specificity types. List them in order of greatest weight to least weight. Give there ‘values’.

A

Inline Declaration Value: 1000
ID Column - only ID selectors Value: 100
Class Column - class selectors, attribute selectors, pseudo-classes : Value: 10
Type Column - Standard Elements and :: (Pseudo)-element-selectors Value: 1
No Value - Universal Selector

24
Q

What does !important do? Give an example to show where it is placed.

A

Overrides everything else. color:blue!important;

25
Q

What CSS command will set a variable/constant for later use?

A

:root {
–variableName: value;
}

reference with
selector {
CSSCommand:var(variableName);
}

26
Q

What is the specificity of combinatorial selectors?

A

they have no effect.