Organising HTML & CSS Flashcards
How do you create an ID and then how do you select an HTML element with an ID?
banana {
< h1 id=“banana”>Botswana
}
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?
< h1 class=“science”>Scientist Finds Important Cure< /h1 >
.science {
font-family: Georgia;
}
How can you label an HTML element with more than one class and is this useful? (Give example)
< 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>
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?
< div > < /div >
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?
p.main {
font-size: 12px;
}