css Flashcards

You may prefer our related Brainscape-certified 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

A

~

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
Q

in css declare a pseudoclass selector

A

a:link, a:hover

26
Q

in css apply an active pseudo class to all active elements

A

:active{ }

27
Q

in css, this structural pseudo class selects the first child

A

:first-child

28
Q

in css, this structural pseudo class selects the last child

A

:last-child

29
Q

in css, this structural pseudo class selects the only child

A

:only-child

30
Q

In css, the only-child structural pseudo class accomplishes what

A

It will only apply a style to elements that are the ONLY child of a given element, and ignore those with multiple children

31
Q

declare a begins-with selector

A

[att^=”val”]

32
Q

declare a ends with selector

A

[att$=”val”]

33
Q

declare a contains selector

A

[att*=”val”]

34
Q

In CSS, how can you set the line spacing for text?

A

line-height:2;

35
Q

in css, select every odd element

A

:nth-child(odd)/even

36
Q

in css define the :nth-element(an+b) syntax

A

b=element to start, a=every ath element (i.e. 3= every third)

37
Q

Which color will be applied, red or blue

<p></p>

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

A

blue

38
Q

in css static positioning does what

A

ignores top,left,bottom,right positioning and z index. sets it to default way a browser renders objects: box

39
Q

in css absolute positioning does what

A

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
Q

in css relative positioning does what

A

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
Q

in css positioning fixed does what

A

always stays in place, i.e. a banner when scrolling down stays attatched to the top

42
Q

in css what is the default positioning

A

static

43
Q

in css, the absolute positioning will always be relative to what

A

the first object with non-static positioning

44
Q

in css, when using relative positiioning and a left and right offset, which side is typically ignored

A

the right

45
Q

in css how can you horizontally align divs

A

float:left

46
Q

in css how can you use two background images and place them accordingly

A

background-image: url(clouds.png), url(background.png);

background-position: top center, bottom center;