CSS 2 Flashcards

(20 cards)

1
Q

static

A

This is the normal positioning scheme in which
elements are positioned as they occur in the normal
document flow.

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

relative

A

– Relative positioning moves the box relative to its
original position in the flow.
– The distinctive behavior of relative positioning is that
the space the element would have occupied in the
normal flow is preserved as an empty space.

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

absolute

A

– Absolutely positioned elements are removed from the
document flow entirely and positioned with respect to
the browser window or a containing element.

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

fixed

A

– The distinguishing characteristic of fixed positioning is
that the element stays in one position in the window
even when the document scrolls.
– Fixed elements are removed from the document flow
and positioned relative to the browser window (or other
viewport) rather than another element in the document.

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

Specifying position

A

– Once you’ve established the positioning method,
the actual position is specified with four offset
properties.
* top, bottom, left, right

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

Relative Positioning– Example:

A

em{
position: relative;
top: 30px;
left: 60px;
background-color: fuchsia;
}

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

Absolute Positioning
Example:

A

em{
position: absolute;
top: 30px;
left: 60px;
background-color: fuchsia;
}

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

Fixed

A

div.fixed {
position: fixed;
top: 0;
left: 0;
width: 300px;
border: 3px solid #73AD21;
}

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

Use the font-family property to specify a font or list of fonts

A
  • body { font-family: Arial; }
  • pre { font-family: Courier, monospace; }
  • p { font-family: “Duru Sans”, Verdana, sans-serif; }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Generic font families– serif

A

Examples: Times, Times New Roman, Georgia

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

Generic font families– sans-serif

A

Examples: Arial, Arial Black, Verdana, Trebuchet MS, Helvetica,
Geneva

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

Generic font families– monospace

A

Examples: Courier, Courier New, and Andale Mono

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

More Selector Types

A

– Element selector
* p { color: navy; }
– Grouped selectors
* p, ul, p, td, th { color: navy; }

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

Descendant selectors

A

– A descendant selector targets elements that are contained
within (and therefore are descendants of) another element.
– Descendant selectors are indicated in a list separated by a
character space.
– Example:
* li em{ color: olive; }
* h1 em, h2 em, h3 em { color: red; }

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

Child selector

A

– A child selector is similar to a descendant selector,
but it targets only the direct children of a given
element. There may be no other hierarchical levels
in between.
– They are indicated with the greater-than symbol (>).
The following rule affects emphasized text, but only
when it is directly contained in a p element. – An emelement inside a link (a) within the paragraph
would not be affected.
* p > em {font-weight: bold;}

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

Adjacent sibling selector

A

– An adjacent sibling selector targets an element
that comes directly after another element with
the same parent.
– It is indicated with a plus (+) sign.
– Other paragraphs are unaffected.
* div + p {font-style: italic;}

17
Q

ID selectors

A

– ID selectors allow to target elements by their id
values. The symbol that identifies ID selectors is
known as a hash symbol.

18
Q

ID selector example

A

<li>Happy Face T-shirt</li>

style{
li#catalog1234 { color: red; }
}

19
Q

Class selectors

A

– Class names are indicated with a period (.) at the
beginning of the selector.
– To select all paragraphs (by <p> element) with
class=“special”, use this selector
* p.special { color: orange; }
– To apply a property to all elements of the same
class, omit the element name in the selector
* .special { color: orange; }

20
Q

The Universal Selector

A

– Example
* * {color: gray; }
– It makes the foreground of every element in the document
gray.
* #intro * { color: gray; }
– It selects all elements in an “intro” section