Organising HTML & CSS Flashcards

1
Q

How do you create an ID and then how do you select an HTML element with an ID?

A

banana {

< h1 id=“banana”>Botswana

}

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

If you want multiple elements to share the same styling, how can you accomplish this and how do you call it in your CSS file?

A

< h1 class=“science”>Scientist Finds Important Cure< /h1 >

.science {
font-family: Georgia;
}

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

How can you label an HTML element with more than one class and is this useful? (Give example)

A

< h1 class=“book domestic”>I like books < /h1 >

<h1>I hate books< /h1 >

.book {
font-family: Arial
}

.domestic {
font-color: MidnightBlue
}

.foreign {
font-color: red
}</h1>

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

When lots of classes and ids are used, code can become unorganised and hard to read, how can we store elements in a container/ box?

A

< div > < /div >

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

When you create class and you want for example the selected paragraph to have a different font size than the other selected elements in the class, how can you do this?

A

p.main {
font-size: 12px;
}

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