CSS Flashcards
What is CSS used for?
Style
Where does CSS go?
A separate file
How do you link your CSS in your HTML document?
<link></link>
Css Syntax
Look up CSS Syntax on MDN
What are the different ways to input color in css?
h1{
color: red;
}
h2{
color: #FF0000;
}
p{
color: rgba(255,0,0,1);
}
span{
color: hsla(0, 100%, 50%, 1);
}
What is a parent child relationship?
A child is an element that is related to another element. For example
<section>
<p>Hello</p>
</section>
The p tag is a child of the parent section.
How would you tag a parent child relationship
section p {
color: red;
}
How would you tag a DIRECT parent child relationship
section > p {
color: red;
}
What is a sibling relationship?
Siblings are tags that are both under the same parent tag. For example
<section>
<p>Hello</p>
<p>Goodbye</p>
</section>
The two paragraphs are siblings.
How would you tag a sibling relationship in CSS
p + p {
color: red;
}
What are IDs used for
Selecting distance elements
How many IDs can be used with the same value
One
What are Classes used for
Selecting multiple elements
How many Classes can be used with the same value
Multiple
What is specificity
Specificity is how many value points something has. If something has a higher value than something else, it can override it since the code thinks its more important.