CSS Flashcards
[CSS Syntax]
What are the names of the individual pieces of a CSS rule?
selector {declaration block}
property: value;
[CSS Syntax]
In CSS, how do you select elements by theirclassattribute?
a period before the element
.element
[CSS Syntax]
In CSS, how do you select elements by their type?
element name
[CSS Syntax]
In CSS, how do you select an element by itsidattribute?
poundsign / hashtag element name
#element
[CSS Colocs]
Name three different types of values you can use to specify colors in CSS.
Hex value, RGBA values, color name
[CSS Box Model]
What CSS properties make up the box model?
margin, border, padding, content/element
[CSS Box Model]
Which CSS property pushes boxes away from each other?
Margin
[CSS Box Model]
Which CSS property add space between a box’s content and its border?
Padding
[CSS Pseudo Classes]
What is a pseudo-class?
A class applied by the browser for special states or html structure
[CSS Pseudo Classes]
What are CSS pseudo-classes useful for?
For simplifying CSS and styling elements in relation to how they are interacted with
[CSS Fonts]
Name two types of units that can be used to adjustfont-sizein CSS.
px, em, rem, %
[CSS Fonts]
What CSS property controls the font used for the text inside an element?
font-family
Is a div a block-level element or inline?
Block-level element
[CSS Flexbox]
What is the default flex-direction of a flex container?
row (left to right)
[CSS Flexbox]
What is the default flex-wrap of a flex container?
no wrap (all flex items on one line)
What unit of size is best for sizing elements that grow and shrink?
rem
[CSS Layout classes]
Why do two div elements “vertically stack” on one another by default?
because they are block elements
[CSS Layout Classes]
What is the defaultflex-directionof an element withdisplay: flex?
row (left to right)
What is the purpose of a row class in an html layout?
sections content in vertical chunks
What is the purpose of a column class in an html layout?
sections content in horizontal chunks
What are utility classes in CSS?
class selectors with specific CSS properties to be easily repeated for multiple HTML elements by adding the class
[CSS Positioning]
What is thedefaultvalue for thepositionproperty of HTML elements?
position: static
[CSS Positioning]
How does settingposition: relativeon an element affect document flow?
everything stays the same as normal flow
[CSS Positioning]
How does settingposition: relativeon an element affect where it appears on the page?
The element will be then moved based on where it was originally placed in the document flow