CSS Flashcards
What are the names of the individual pieces of a CSS rule?
CSS rule set consists of:
A selector & declaration.
Inside declaration is a property & value.
In CSS, how do you select elements with theirclassattribute?
Period & class value.
In CSS, how do you select elements by their type?
Just simply write their element name.
In CSS, how do you select an element with itsidattribute?
Hashtag & id name.
Name three different types of values you can use to specify colors in CSS.
HEX codes, writing out the color names, & the RGB value.
What CSS properties make up the box model?
Height & Width (from the content), padding, border, & margin.
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 pseudo-class isa class applied by the browser that selects elements that are in a specific state.
What are CSS pseudo-classes useful for?
Styling links, & responding to users by highlighting their current position.
Name two types of units that can be used to adjustfont-sizein CSS.
Pixel, em, rem & percent.
What CSS property controls the font used for the text inside an element?
Font-family property.
What is the defaultflex-directionof aflexcontainer?
Left to right (row).
What is the defaultflex-wrapof aflexcontainer?
No wrap.
Why do two div elements “vertically stack” on one another by default?
Because they are block elements, by default.
What is the defaultflex-directionof an element withdisplay: flex?
Left to right (row).
What is thedefaultvalue for thepositionproperty of HTML elements?
The “static” position.
How does settingposition: relativeon an element affect document flow?
Relative positioning moves an element in relation to where it would have been in the NORMAL FLOW (aka static).
How does settingposition: relativeon an element affect where it appears on the page?
Same spot. Nothing changes.
How does settingposition: absoluteon an element affect document flow?
It doesn’t affect the document flow at all. The idea of the value “absolute”, is that the box is taken out of normal flow and no longer affects the position of other elements on the page.
How does settingposition: absoluteon an element affect where it appears on the page?
Position absolute takes the document out of the document flow. This means that it no longer takes up any space like what static and relative does. When position absolute is used on an element, it is positioned absolutely with reference to the closest parent that has a position relative value.
How do you constrain an absolutely positioned element to a containing block?
Change the position to fixed.
What are the four box offset properties?
Top, bottom, left, right.
What are the names of the individual pieces of a CSS rule?
CSS rule set consists of:
A selector & declaration.
Inside declaration is a property & value.