css Flashcards

1
Q

declare that a page is using an external style sheet using html

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

what is one difference in using @import vs a css style in regards to browsers

A

some browsers will hide @import from user in source

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

when using css and @import, where does the @import need to be located

A

at the top, preceeding other elements

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

in regards to @import, what is one disadvantage in regards to performance

A

each @import must call back to the server

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

in css what does a universal selector accomplish

A

selects every element on a page

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

how do you use a universal selector in css

A

*{ }

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

browsers have a user agent style sheet that accomplishes what

A

sets a default style to elements on a page, i.e. padding, margin etc.

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

the universal selector trumps inheritance in css t, or f

A

true

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

in css what does a type selector accomplish

A

selects a page element i.e. h1, p, etc

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

in css define a type selector

A

elementname { style properties }

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

in css define a descendent selector

A

selector1 selector2 { style properties }

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

in css define an element with two classes

A

div class=”class1 class2”

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

in css define a descendent selector with the first element being a class

A

.class1 selector1

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

in css which has more weight in importance, class or id

A

id

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

in an external css style sheet, define a style for two classes

A

.class1, .class2 {
style
}

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

in css what symbol defines a child combinator

A

>

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

in css define a child combinator

A

an element directly nested within an element

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

in css what symbol defines an adjacent sibling combinator

A

+

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

in css define an adjacent sibling combinator

A

an element immediately following an element`

20
Q

in css what symbol defines every a general sibling combinator

21
Q

in css define a general sibling combinator

A

every sibling element of given element

22
Q

in css attribute selectors are decorated with what symbol

A

[ ] sq brackets

23
Q

in css select an element with a class of a specific name

A

a[class=”classname”]

24
Q

in css select an element with a text attribute

A

input[type=”text”]

25
in css declare a pseudoclass selector
a:link, a:hover
26
in css apply an active pseudo class to all active elements
:active{ }
27
in css, this structural pseudo class selects the first child
:first-child
28
in css, this structural pseudo class selects the last child
:last-child
29
in css, this structural pseudo class selects the only child
:only-child
30
In css, the only-child structural pseudo class accomplishes what
It will only apply a style to elements that are the ONLY child of a given element, and ignore those with multiple children
31
declare a begins-with selector
[att^="val"]
32
declare a ends with selector
[att$="val"]
33
declare a contains selector
[att*="val"]
34
In CSS, how can you set the line spacing for text?
line-height:2;
35
in css, select every odd element
:nth-child(odd)/even
36
in css define the :nth-element(an+b) syntax
b=element to start, a=every ath element (i.e. 3= every third)
37
Which color will be applied, red or blue

p.title{ ... } p.summer{color:red} p.newproduct{color:blue}

blue
38
in css static positioning does what
ignores top,left,bottom,right positioning and z index. sets it to default way a browser renders objects: box
39
in css absolute positioning does what
positions an element with w/e offsets WITHIN its parent eolement (so by default top left of parent)-- if no parent, the browser viewport is parent
40
in css relative positioning does what
positions an element without influencing position of other elements using top left bottom etc (it is offset relative to original positioning, thus the following element uses the position of this element's non-offset positioning to position itself
41
in css positioning fixed does what
always stays in place, i.e. a banner when scrolling down stays attatched to the top
42
in css what is the default positioning
static
43
in css, the absolute positioning will always be relative to what
the first object with non-static positioning
44
in css, when using relative positiioning and a left and right offset, which side is typically ignored
the right
45
in css how can you horizontally align divs
float:left
46
in css how can you use two background images and place them accordingly
background-image: url(clouds.png), url(background.png); | background-position: top center, bottom center;