Tables, Lists and Links Flashcards

1
Q

Table properties

A

border: controls the border property of the table
you can manipulate a border’s color, style or thickness

border-collapse which allows padding and margin calculation to be included in the border’s width
values: collapse or separate

caption-side specifies either bottom or top for the caption to be placed
values: bottom, top (default), left, right

border-spacing controls the spacing of borders in-between cells
border-spacing: 2px 4px;
specifies horizontal and vertical

empty-cells is a property that you can use to toggle displaying or hiding the empty cells of a table
values: hide, show, etc

table-layout will alter the width of the table based on content size or fixed widths

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

List properties

A

list-style-type controls the type of character to use to enumerate the list items.For example, you can specify letters only, numbers only, and more.

list-style-image will render an image in place of the bullet or alphanumeric value used to label the list item.Instead of seeing the number 1, for example, you would see the image of a lightning bolt.

list-style-position specifies the location to place the label for the list item.You will either use outside (which is default) and places the demarcating character outside the content flow; or inside, by contrast, which changes the position to be inside the content flow.

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

Links/Anchor tag properties

a: link {color: red
background : white}
a: visited {}
a: hover {}
a : active {}
A

-applies to the link

link (default)

visited - when link has been clicked before

hover - when mouse is positioned over the link

active - mouse down (when user is actively clicking the anchor

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

Units of measurement rules : absolute or relative

A
  • you can have negative margin but not negative padding
  • express properties in terms of a value
  • express zero without a unit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Absolute units

A

measurement is based on length of unit and not other element

ex:
cm
in
pixels
points 
picas
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Relative units

A

measurement is based on dimensions of another element
or component of the page

ex:
em: are relative to the font-size property of the current element

rem: are relative to the root element of the page
ch: relative to the width of the zero character

%: usually based on its parent element or the actual browser’s window depending on the property you are specifying

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

Common height based properties

A

Unlike width which is ultimately based on a browser’s window, height, if expressed in terms of percent, is based on its parent element.

If you want to make a <div> element for example stretch to half the height of the window, you must first set the element and in some cases the element as well to have a height of 100%. Otherwise, the <div> element calculates 100% based on an undefined value which equates to 0. And so, 100 percent of zero will always equate to zero.

Width on the other hand is calculated different by the browser and always traces back to 100% of the window, even if you don’t expressly set the body or html elements to a specific width.</div></div>

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

Box model*

A

-is a way for the drawing (rendering) engine to layout and display elements

-composed of 4 containers:
margin: outermost layer
border:
padding:
content:

  • Margin is the outermost layer. It controls spacing from other elements.
  • border property which allows developers to specify a color and outline for an elements.

-After border is padding, which controls the space between a border and the contained content.

You can also specify different values for each side of an element.

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

Controlling sidderent sides

shorthand

A

You can also specify different values for each side of an element.
-div elements can have padding for top, bottom and side

If you specify two values as shown, the first will be used for the top and bottom sides and the second for the right and left sides.
div {
padding: 1px 2px 3px
}

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

Position property (positioning)

A

-specifies the layout of elements on a webpage

valid values:
absolute
fixed
relative
static (default)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Specifying position

A

after setting the layout, you can specify any offsets for any side (left, right, top, bottom)

ex: div { position: fixed;
top: 0;
}

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

Relative positioning

A
  • sets the element relative to its normal flow
  • specify the left and/or top offsets

In practice, it is best to set the top and left properties as opposed to trying to set an element relative to a bottom or right edge. Also of note, elements that are positioned relative leave blank spaces where they would normally be.

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

Absolute positioning

A

-sets relative to its parent or relative to the document body if the parent is positioned statically.

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

Fixed positioning

A

-relative to the browsing window

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

Z-index property

A
  • browsers will render elements on top of another depending on position
  • use the Z-index property to specify which element will reside on top of another
valid values:
integer values (if negative, it will be behind other elements)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Float property

A

-used to set an element along the left or right of its container and allows text to wrap around it

or -

valid values:
left
right
none

17
Q

Clear property

A

specifies which sides(s) to disallow elements to float to

valid values:
left
right
both

18
Q

Overflow property

A

specifies how to display content that falls outside of its container

valid values:
hidden - hides content that flows out of container
scroll - scroll bars
visible - content overflows out of container
auto - contents that flows out is not displayed

19
Q

Positioning summary

A

You can use the float property to align an element to the right or left side of its container allowing text or other elements to wrap around it.And, also, the overflow property can specify how content that doesn’t fit inside its parent is rendered on the page.