CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector, declaration block, property, value
In CSS, how do you select elements by their class attribute?
.
In CSS, how do you select elements by their tag name?
just the name of the element 4head
In CSS, how do you select an element by its id attribute?
#
What is a pseudo-class?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).
What are CSS pseudo-classes useful for?
used to add styles to selectors, but only when those selectors meet certain conditions. A pseudo class is expressed by adding a colon (:) after a selector in CSS, followed by a pseudo-class such as “hover”, “focus”, or “active”, like this: a:hover { /* your style here */ }
Name two types of units that can be used to adjust font-size in CSS.
What CSS property controls the font used for the text inside an element?
font-family
Why do two div elements “vertically stack” on one another by default?
they’re block elements
What is the default flex-direction of an element with display: flex?
row
What are the three primary components of a page layout? (Which helper classes do you need?)
visual heirarchy, visual flow, grouping/alignment
What is the minimum number of columns that you should put in a row?
1
What is the purpose of a container?
easier to organize shiet
How does setting position: relative on an element affect where it appears on the page?
move relative to where it normally would exist if it was static
How does setting position: relative on an element affect document flow?
it has no affect on document flow