Divs And Spans Flashcards

1
Q

What is a <div> used for?

A

Elements grouped together particularly for styling

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

How do you give a unique label to the elements in a div tag?

A

Usually with an id attribute

div id = “cats”

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

The height of an element is left at the default, which is…

A

Auto

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

___ allows the content to fill the available space, after taking into account __________, __________ and ___________.

A

Auto
Padding
Border
Margin

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

Which property aligns all the inline content (text, images, etc) in a block element?

A

text-align

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

How do you tell CSS to only select elements that descend from certain elements?

A

descendant selector

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

For the following rule, which is the parent element and which is the descendant selector?
div h2 {
Color : black ; }

A

div is parent

h2 is descendant

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

If the padding is 0px 20px 30px 10px

which is top, bottom, right, left?

A

0 is top
20 is right
30 is bottom
10 is left

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

Can use use “1” as the line-height property and what will it do?

A

Yes. It will make the line height x1 of whatever the font size is for each element

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

What is the shorthand for padding and margin?

A

margin : 0 px 20 px ;

Zero represents top and bottom margin and 20 represents right and left margin

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

Does order matter for border properties?

A

No. thin solid black is same as black thin solid

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

For font shorthand, does order matter?

A

YES.

font-style font-variant font-weight are optional but must come before font-size

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

When using the font property, what is not optional?

A

Font-size

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

What does span do?

A

Gives you a way to create a group of inline characters and elements

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

With the text: “My mother has blue eyes.” How would you make the word “blue” have blue text?

A

Put the word “blue” in a span.

< span style = “color : blue” < blue < /span >

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

How do you use span in CSS using classes?

A

Put the text inside a span element including the class
< span class = “artist” > Madonna </ span >
and write the style in CSS
. artist {
font - weight : bold ;
}

17
Q

Best practice for order of “a” element states?

A
link
visited
hover
focus
active
18
Q

A pseudo class acts like a class but isn’t a real class. T or F?

A

True

19
Q

A CSS rule consists of a selector and a ____________

A

Declaration or multiple declarations

20
Q

“Cascade” means the styles are coming from multiple style sheets that all fall into the page. T or F?

A

True

21
Q

When does the “focus” state occur?

A

When the browser focuses in your link by tabbing to rotate through the links on your page.

22
Q

When does the “active” state occur?

A

When the user first clicks in a link

23
Q

What is a common way to group related elements for styling?

A

“div” tags by putting div tags around the elements