CSS Flashcards
What is the purpose of the CSS inherit property?
Certain attributes are not automatically inherited, those can be forced to inherit using this property.
Name three different types of values you can use to specify colors in CSS.
Named colors / Hex / RGB
What CSS properties make up the box model?
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 does “Border Box” accomplish?
It includes the border and padding into the total width and height.
What is a pseudo-class?
To target a special state of an element.
What are CSS pseudo-classes useful for?
To change the styling of elements.
How do you declare direct child in CSS selector?
a > b
How do you declare descendant in CSS selector?
a b
Name at least two units of type size in CSS.
px / rem
What CSS property controls the font used for the text inside an element?
font-family
What does “margin: auto” do?
Centers the item on the page horizontally if the element has been given a width.
What is justify-content used for?
How the group of items should appear on the page horizontally.
What is align-content used for?
How the group of items should appear on the page vertically.
What is align-items used for?
How each individual item should be displayed on the vertical axis.
What is flex-basis used for?
The width of each item.
When would it be ok to wrap input in a label?
With radio and checkbox
Why do two div elements “vertically stack” on one another by default?
Because they are block elements.
What is the default flex-direction of an element with display: flex?
Row.
What is the default flex-wrap of a flex container?
No wrap.
What is the default value for the position property of HTML elements?
Static.
How does setting position: relative on an element affect document flow?
Doesn’t affect.
How does setting position: relative on an element affect where it appears on the page?
Moves it from where it would normally be.