CSS3 Flashcards

1
Q

Box Model order

A

Content, Padding, Border, Margin

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

Content

A

text inside of an HTML element

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

Padding

A

space within an element’s border (or inside of margin if there is no border)

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

Border

A

forms a line around the element (and padding)

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

Margin

A

space outside of the element’s border, or outside the padding if there is no border

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

Trick to centering content

A

width: 650px;
margin: 0 auto
- set fixed width; sets left/right margin to auto centers content horizontally
- set these attributes to a div with ID “wrapper”
- wrap div around site’s content, centers even when window resizes.

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

elements that are usually inline

A

<i></i>
<span></span>
<b></b>

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

box-sizing inline elements

A
  • can’t have margin/padding on their top/bottom

- can be next to other elements

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

box-sizing block elements

A
  • can have margin/padding on their top/bottom

- cannot be next to other elements

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

elements that are usually block

A

<p></p>

<div></div>

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

attribute to change an element’s default behavior

A

display

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

display: inline

A

element is displayed inside the current block on the same line as other elements it is near

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

display: block

A

element tolerates no elements next to it unless a float is used

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

display: inline-block

A

allows a block element to be next to another block element, but still have vertical padding/margins

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

float: left/right

A

move an element all the way to the left/right side of its container and have all other elements flow around it

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

clear: both

A

remove the effects of a floated container. applied to an element after a floated container to remove the effects of using float

17
Q

to create a page with two columns

A

float the first AND second container left. elements will stack on top of one another.

If I decrease the width of the page, the second element will float beneath the first automatically.

18
Q

using float to create an image gallery

A

☞ You could use float: left; to create a dynamic image gallery
☞ float each image left and give it a margin-right and margin-bottom to enforce space
☞ As you resize the page, the images will stack nicely

19
Q

to float text around an image

A

☞ To add an image to the page with text flowing around it, float it left
☞ Try adding some margin-rightand margin-bottom to the image

20
Q

clearing floats

A

☞The clear property will move the element down past
surrounding floated elements
☞ clear has 4 possible values: both, left, right and none (default)
☞ if there is no content to clear after a floated element, use the <br></br> element

21
Q

CSS positioning does what now?

A

Using the CSS position attribute, you can use X and Y values to move elements around the screen based on different frames of reference
(it is a last resort)

22
Q

CSS positioning

A

left, right, top, and bottom are used to specify an offset, the reference point of which is determined by the type of positioning specified (fixed, absolute,
relative, etc.)

23
Q

position left

A

For left, offset values that are positive will move your element to the right while negative values will move it to the left.

24
Q

position right

A

offset values that are positive will move your element to the left while negative values will move it to the right.

25
position top
offset values that are positive will move your element down while negative values will move it up
26
position bottom
offset values that are positive will move your element up while negative values will move it down
27
position: relative
☞ Relative to the container that it's in ☞ Using position: relative; you can position your element relative to where it would normally be on screen ☞The element is still in the normal "flow" of the page, it still takes up space ☞ Works well to make small changes in position unachievable through margin or padding
28
position: absolute
☞ Using position: absolute; you can position your element relative to the entire page ☞The element will not be in the normal "flow" of the page, it will not take up space ☞This is how "modal" elements are created
29
attribute used to define layer in relation to other elements on the page
z-index: