CSS Flashcards
CSS Syntax:
What are the names of the individual pieces of a CSS rule?
a selector and a declaration
(a declaration is made up of a property and property value)
CSS Syntax:
In CSS, how do you select elements by their class attribute?
.nameOfClassAttribute
CSS Syntax:
In CSS, how do you select elements by their tag name?
just their name
CSS Syntax:
In CSS, how do you select an element by its id attribute?
(pound)nameOfIdAttribute
CSS Colors:
Name three different types of values you can use to specify colors in CSS
rgb values, hex code, color names
CSS Box Model:
What CSS properties make up the box model?
margin, border, padding, and content (height/width)
CSS Box Model:
What 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 Class:
What is a pseudo-class?
it is a selector that selects elements that are in a specific state
CSS Pseudo Class:
What are CSS pseudo-classes useful for?
pseudo classes let you apply style to an elements that are in a specific state
CSS Fonts:
Name two types of units that can be used to adjust font-size in CSS
pixels, rem
CSS Fonts:
What CSS property controls the font used for the text inside an element?
font-family
CSS Flexbox:
What is the default flex-direction of a flex container?
left to right
CSS Flexbox:
What is the default flexwrap of a flex container?
nowrap, all on one line
CSS Layout Classes:
Why do two div elements “vertically stack” on one another by default?
They vertically stack because they are block elements
CSS Layout Classes:
What is the default flex-direction of an element with display: flex?
Row
CSS Layout Classes:
What are the three primary components of a page layout? (which helper classes do you need?)
Containers. Rows. Columns.
CSS Layout Classes:
What is the minimum number of columns that you should put in a row?
at least ONE
CSS Layout Classes:
What is the purpose of a container?
It sets a boundary for the layout (content) by giving it a max-width
CSS Positioning:
What is the default value for the position property of HTML elements?
static
CSS Positioning:
How does setting position: relative on an element affect document flow?
there is no affect to document flow
CSS Positioning:
How does setting position: relative on an element affect where it appears on the page?
it would move relative to where it exists in a static position
CSS Positioning:
How does setting position: absolute on an element affect document flow?
it becomes removed from the document flow completely
CSS Positioning:
How does setting position: absolute on an element affect where it appears on the page?
it’ll get positioned within the boundaries of its nearest non-static ancestor