CSS Flashcards
(33 cards)
What are the names of the individual pieces of a CSS rule?
Rule set, selector, declaration/declaration block, property, value.
In CSS, how do you select elements by their class attribute?
With a dot/period ( . )
In CSS, how do you select elements by their tag name?
With the tag/element name.
In CSS, how do you select an element by its id attribute?
With the #.
Name three different types of values you can use to specify colors in CSS.
Hexidecimal, rgba, hsla.
What CSS properties make up the box model?
Height, width, padding, border, margin.
Which CSS property pushes boxes away from each other?
Margin.
Which CSS property adds 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(s).
What are CSS pseudo-classes useful for?
Giving additional information, additional functionality, and applying styles.
Name two types of units that can be used to adjust font-size in CSS.
Pixels, rem.
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?
Default flex-direction is row.
What is the default flex-wrap of a flex container?
Default flex-wrap is nowrap.
What does justify content do?
This defines the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow the line.
What does align-items do?
This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).
Why do two div elements “vertically stack” on one another by default?
They are block-level 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?)
Container class/element, row class/element, column class/element.
What is the minimum number of columns that you should put in a row?
One.
What is the purpose of a container?
To hold the row class/element, and the column class/element. (Also to provide additional styling/functionality).
What is the default value for the position property of HTML elements?
Default position property is Static.
How does setting position: relative on an element affect document flow?
Relative position moves an element in relation to where it would have been in normal flow. (Document flow is unaffected).
How does setting position: relative on an element affect where it appears on the page?
Position: relative will have no affect until a box offset property is set. It will then move relative to where it would have been in normal flow.