CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector, declaration (declaration block), property, and value
In CSS, how do you select elements by their class attribute?
period then name of file
ex: .class
In CSS, how do you select elements by their type?
Type selector. You just type the element name that matches html tag element.
Ex: h1 –which would match to h1–
In CSS, how do you select an element by its id attribute?
#. ID selector. Ex: #indroduction --this targets the id attribute has a value of introduction--
Name three different types of values you can use to specify colors in CSS.
RGB values (ex: rgb(100,100,90)), Hex codes (ex: #ee3e80), Color Names
What CSS properties make up the box model?
Margin, Border, Padding, Content
Which CSS property pushes boxes away from each other?
Margin
Which CSS property add space between a box’s content and its border?
Padding
What is a pseudo-class?
A keyword added to a selector that specifies a special state of the selected element.
Ex: selector:hover {
color:blue;
}
What are CSS pseudo-classes useful for?
Activates a function when a condition in the selector is met.
Name at least two units of type size in CSS.
px, ems, and %.
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
Row (going from left to right)
What is the default flex-wrap of a flex container?
nowrap. It is used to specify that the item has no wrap. It makes item wrap in single lines.
What are the four components of “the Cascade”.
Four steps in the cascade algorithm, in order: Relevance. Origin and importance. Specificity. Order of appearance.