Fundamentals Flashcards

1
Q

What is CSS syntax?

A

Selector and Declaration.

A Declaration is composed of Property: Value;

h1 { font-size: 12px; }

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

What are the three ways to add CSS to a document and their cascading order?

A

Internal CSS (2), External CSS (2), and Inline CSS (1).

[browser default is priority 3]

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

How do you write comments in CSS?

A

/* multi line comment */

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

What is background shorthand?

A

When using the shorthand property the order of the property values is:

background-color
background-image
background-repeat
background-attachment
background-position

body {
background: #ffffff url(“img_tree.png”) no-repeat right top;
}

It does not matter if one of the property values is missing, as long as the other ones are in this order.

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

What is border shorthand?

A

The border property is a shorthand property for the following individual border properties:

border-width
border-style (required)
border-color

p {
border: 5px solid red;
}

works for border-left, border-top, border-right, border-bottom

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

What is Margin Collapse?

A

When a top and bottom margin become one margin, equal to the largest of the two margins.

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

What are Margins?

A

Empty space around elements, outside of defined borders.

p {
margin: 25px 50px 75px 100px;
}

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

margin: auto;

A

Centers the borders within it’s container horizontally.

can be overriden with margin: inherit;

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

What is padding?

A

Space between the content and its borders.

div {
padding: 25px 50px 75px 100px;
}
//top right bottom left

If the padding property has three values:
top
right and left
bottom

if two values top/bottom right/left

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

What can be used for height and width values?

A

auto, length [px, cm, etc.], %, inherit, initial

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

What are the dimension properties

A

height, width
max-height, max-width
min-heigh, min-width

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

CSS Box Model

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

What is a CSS Outline?

A

What goes outside borders.
outline-style: solid //outline style must be set.
outline-color: …;
ourline-width: …;

outline-offset adds space between the outline and the border.

outline shorthand:
p.ex3 {outline: 5px solid yellow;}
p.ex4 {outline: thick ridge pink;}
//order doesn’t matter

It can inherit the outlines styles of borders, but is not a border

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

What are the web safe fonts?

A

Arial (sans-serif)
Verdana (sans-serif)
Tahoma (sans-serif)
Trebuchet MS (sans-serif)
Times New Roman (serif)
Georgia (serif)
Garamond (serif)
Courier New (monospace)
Brush Script MT (cursive)

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

What are CSS icons?

A

Icons that can be inserted through CSS

fontawesome.com
google icons

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

What are the four link states?

A

a:link - a normal, unvisited link
a:visited - a link the user has visited
a:hover - a link when the user mouses over it
a:active - a link the moment it is clicked

17
Q

display

A

controls how the element is displayed…

display: block; //as a block element
display: inline //default as an inline element
display: none; //hides the element, takes no space

in contrast to
visibility: hidden //hides the element, but space is reserved

18
Q

position: static;

A

the default position for an element, follows the normal flow of the page.

19
Q

position: relative;

A

the element will be adjusted ‘relative’ to it’s normal position

20
Q

position: fixed;

A

the element will be relative to the viewport.

good for nav elements.

21
Q

position: absolute;

A

Well be relative to it’s nearest ancestor, instead of the viewport

22
Q

position: sticky;

A

toggles between relative and fixed depending on the scroll position

23
Q

z-index

A

specifies the stack order for elements, can be positive or negative.

if not specified the most recent element will be on top.

24
Q

overflow

A

specifies how to handle overflow

visible //default, not clipped and spills out
hidden //overflow is clipped content becomes invisible
scroll //adds scrollbar
auto //only adds scrollbar when necessary

25
Q

How can you center an image?

A

{
margin-left: auto;
margin-right: auto;
}

26
Q

How can colors be defined in CSS?

A

with
RGB(255, 255, 255) // 0 -> 255

Hex #ffffff //00 -> ff

hsl(9, 100%, 64%)

rgba, and hsla (4th parameter for transparency)

27
Q

What are the parameters of CSS transition?

A

/* property name | duration | easing function | delay */
transition: margin-right 4s ease-in-out 1s;

/* property name | duration | easing function */
transition: margin-right 4s ease-in-out;

/* property name | duration | delay */
transition: margin-right 4s 1s;

/* property name | duration */
transition: margin-right 4s;

28
Q

What are the transition properties?

A

transition-delay
transition-duration
transition-property
transition-timing-function