General Flashcards

1
Q

css: box-sizing: border-box

A

Makes the size inclusive of border and padding

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

css: margin: 0 auto;

A

helps to centre horizontally, a width must be set for it to work

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

css: .breadcrumb li+li::before {
content: “>”;
}

A

Separator in breadcrumbs

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

css: display: flex;
Or. display: inline-flex

A

Designate an item as a flex container

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

css {
justify-content: flex-start;
flex-end;
centre;
space-around;
space-between

A

Five commonly used options to distribute within a flex-container.

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

css {
align-items: flex-start;
flex-end;
center
baseline;
stretch;

A

5 commonly used align-items properties to flex vertically -cross axis- within a flex-container

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

css {
flex-basis: npx
}

A

To specify a width of an item before it stretches or shrinks.

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

css {
flex-wrap: wrap;
wrap-reverse;
no-wrap;

A

Use on containers to apply to child items

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

css {
align-content: flex-start;
flex-end;
center;
space-between;
space-around;
stretch;

A

For aligning multiple rows vertically in a flex container. essentially shares values with align items.

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

css: {
flex-flow:

A

Shorthand for flex direction and flex-wrap (in this order).

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

css {
flex: (flex-grow flex-shrink flex-basis)

A

Flex is shorthand for the 3 values

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

css {
display: grid;
}

A

Setup a grid!

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

css: cursor: pointer;

A

Change the arrow to a point hand

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

css: ELEMENT:hover {

A

pseudo class to do something when the cursor is over it

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

css {
gap: rowpx colpx;
}

A

Set row and column spacing

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

CSS {
grid-template-ROWS/COLUMNS: npx minmax(npx, npx) npx;
}

A

Define rows or columns sizes with middle one having size limits set for scaling

17
Q

CSS {
grid-template-ROWS/COLUMNS: repeat(n, 100px)
}

A

Repeat a unit size n times

18
Q

CSS {
grid-template: npx n% nfr / n% npx;
}

A

Shorthand for grid-template-ROWS/COLUMNS
Actually laid out rows / columns

19
Q

CSS {
grid-row: n / n;
(or grid-column)
}

A

Short hand for row-start and row-end (in that order)

20
Q

CSS {
grid-area: rowStart / colStart / row end / col end;
}

A

Short hand for grid-row and grid-column combined

21
Q

css {
grid-template-areas:
“header header”
“left right “
“footer footer”;
}

A

Allows you to name sections (elements or classes) to define grid-row-start etc.
Declare it in the grid container

22
Q

CSS {
grid-area: left/right/footer;
}

A

How to define a grid area for an grid element within a grid container

23
Q

css {
z-index: 5;
}

A

Brings an object forward or back in layers (especially in grid overlaps)

24
Q

CSS {
grid-auto-COLUMNS/ROWS;

A

Specifies the HEIGHT/WIDTH of those implicitly added to the grid

25
Q

CSS {
grid-auto-flow: ROW/COLUMN

A

Specify in which direction implicit elements should be created

26
Q

.container {
width: 50%;
height: 200px;
overflow: hidden;
}

. container img {
max-width: 100%
height: auto;
display: block;
}

A

Represents a container div.
Setting to overflow hose ensure any content with dims larger than the container will be hidden
Second rule images scale with the container.
In block rather than inline-block (which is default) so that they don’t try aligning with other things.
This should be memorised. Handy for images and videos!!

27
Q

CSS a[href*=“example”] {

A

An attribute selector:
The * permits a partial match on the substring
A ^ selects all string with a substring
Using a $ would be for ending with a substring (like a file extension for eg)

28
Q

<meta name=“viewport” content=“width =device-width, initial-scale =1”>

A

meta tag to instruct the browser how to render scale and dimensions
=Same width as screen
=same width as device
=zoom level

29
Q

@media only screen and (max-width: 480px) { body {
then nest any media specific css
}
}

A

Media query being applied to screens smaller than 480px (cell phones in landscape)