CSS Flashcards

(57 cards)

1
Q

content vs style

A

info to be presented vs how info is presented

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

HTML’s main role

A

define content

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

Cascading Style Sheets main role

A

defining style, used to specify presentation of elements separately from doc

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

CSS advantages

A
  • separation of content from presentation
  • site-wide consistency
  • reduced data transfer over a network
  • easy to reformat pages for device portability
  • better accessibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

style sheet

A

set of rules specified in <style> html element located in <head></style>

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

CSS selectors

A

.class, #id, element, space, :hover, “,”

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

.class

A

.intro selects all elements with class=”intro”

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

id

A

firstname selects the element with id=”firstname”

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

element

A

p selects all <p> elements

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

space

A

div p selects all p elements inside <div> elements

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

,

A

div, p selects all <div> elements and all <p> elements

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

:hover

A

a:hover selects <a> element on mouse over</a>

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

a.nodec means?

A

selects <a> elements with class=”nodec”</a>

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

3 ways to specify CSS styles

A

inline, embedded, external

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

inline styles

A

not recommended, only apply to element where style is declared, does not truly separate presentation from content

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

embedded styles

A

styles declared in an HTML document’s head section, apply to entire HTML doc

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

external styles (preferred)

A

styles defined in an external style sheet, apply to all HTML docs on a site

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

linking external CSS

A

(in head, below title)

<link></link>

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

inheritance

A

most styles defined for parent elements are also inherited by child (nested) elements

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

specificity

A

styles specified for child elements have higher specificity and take precedence over styles defined for their parent elements

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

specificity precedence

A

inline styles > IDs > classes > elements > Child element styles > parent element styles

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

origin precedence

A

when there are two different specified styles for an element, the declaration at the bottom wins

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

source

A

styles may be defined by the author (developer), the user, or the user agent (browser)

24
Q

source style conflict

A

authors styles > users styles > user agents styles

25
font-weight property
specifies boldness of text - bold, normal, bolder - can be specified with multiples of 100, 100-900
26
text specified as normal is ____, and bold is _____
400, 700
27
font-family property
specifies name of the font to use (use Arial, helvetica, sans-serif)
28
generic font families allow
authors to specify a type of font instead of specific font in case browser does not support specific font
29
font-size property
point size or relative value (xx-small to xx-large). relative are preferred b/c author doesn't know specific measurements of each client's display and relative permits more flexible viewing of web pages.
30
a point size value is formed by
number followed by two-letter abbreviation indicating unit (px, in, cm, em, rem, etc.) p {font-size: 0.4em}
31
em
relative to font-size of element
32
font-style property
sets text to none, italic, oblique
33
text-decoration property
underline, overline, line-through, blink
34
text-align property
text in an element can be centered using text-align: center/left/right
35
text-indent property
indents first line of text in element by specified amount
36
text-shadow property
horizontal (pos=right), vertical (pos=down), blur radius, color of shadow h1 {text-shadow: -4px 4 px 6px dimgrey;}
37
relative positioning
element is positioned relative to its normal position in the document flow
38
in relative positioning, HTML elements are positioned
from top to bottom and from left to right
39
CSS position property
allows absolute positioning, which provides greater control over where on a page elements reside
40
normally, elements are positioned on the page in the order in which
they appear in the HTML5 document
41
specifying absolute position
removes it from normal flow of elements on page and positions it according to distance from margins of parent elements
42
z-index property
allows a developer to layer overlapping elements, higher values are displayed in front of lower value elements
43
when browser renders element using box model, content is surrounded by
padding, a margin, and a border
44
padding property
determines distance between content inside element and edge of element's border
45
padding set for each side with
padding-top/right/left/bottom
46
margin
determines distance between element's edge and any outside text
47
margin set for each side with
margin-top/right/left/bottom
48
CSS Box Model inside -> out
Content, padding, border, margin
49
you can make an inline element behave like a block element using
display property .block-element { display: block;}
50
border properties
border-width, border-color, border-style (none, hidden, dotted, dashed, solid)
51
CSS can control backgrounds of block-level elements by adding
background-color, background-image
52
background-repeat property
controls tiling of background image - no-repeat means one copy on screen - repeat (default) tiles image horizontally and vertically - repeat-x tiles image only horizontally - repeat-y vertically
53
background-image
specifies URL of image
54
background-position
top, bottom, center, left, right places image on page
55
syntax of animation
{animation: name timing-function duration delay iteration-count direction}
56
animation: timing-function
type of animation (linear, ease, ease-in, ease-out, cubic-bezler)
57
define animation movingimage
@keyframes movingimage