CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Inside a CSS ruleset:
Selector + Declaration Block
Inside the Declaration Block:
Opening.Curly Braces ( { ) + Property + Value + Closing Curly Braces ( } )Inside a CSS ruleset:
Selector + Declaration Block
Inside the Declaration Block:
Opening.Curly Braces ( { ) + Property + Value + Closing Curly Braces ( } )
In CSS, how do you select elements by their class attribute?
period (dot) before class title
e.g. .class_name { };
In CSS, how do you select elements by their type?
Element name { } ;
In CSS, how do you select an element by its id attribute?
Hash-tag before the id title
e.g. #id_title { };
Name three different types of values you can use to specify colors in CSS.
Hex
RGBa
RGB
HSL (Hue Saturation Lighting)
HSLa
Color Name
What CSS properties make up the box model?
Margin
Border
Padding
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 is added to a selector to specify a certain interaction that occurs when the user interacts with the selected element/id/class specified.
:hover
:focus
:active
What are CSS pseudo-classes useful for?
CSS pseudo-class is useful for changing the appearance of elements when a user is interacting with them.
Name two types of units that can be used to adjust font-size in CSS.
px - pixels
rem - root em (approx. 16px)
% - percentage
What CSS property controls the font used for the text inside an element?
font-family property
What is the default flex-direction of a flex container?
flex-direction: row (default)
Default direction is left to right which is in a “row”
What is the default flex-wrap of a flex container?
flex-wrap: no-wrap (default)
default flex-wrap for a container is no-wrap which means all on one line
Why do two div elements “vertically stack” on one another by default?
div elements are block-type elements and so will start a new line when “stacked” on one another