CSS Flashcards
Name three different types of values you can use to specify colors in CSS
color names, or RGB, HEX, HSL, RGBA, HSLA values.
What CSS properties make up the box model?
margin, border, padding, content
Which CSS property pushes boxes away from each other?
The margin CSS property pushes boxes away from each other
Which CSS property adds space between a box’s content and its border?
The CSS property that adds space between a box’s content and its border is the padding property
What is a pseudo-class?
A pseudo-class is used to define a special state of an element.
it can be used to:
Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus
What are pseudo-classes useful for?
A pseudo-class is used to define a special state of an element.
it can be used to:
Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus
Name two types of units that can be used to adjust font-size in CSS
pixels, em, percentages
What CSS property controls the font used for the text inside an element?
The CSS property that controls the font used for the text inside an element is the font-family property
What is the default flex-direction of a flex container
The default flex-direction of a flex container is left to right, in a row
What is the default flex-wrap of a flex-container
By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
Why do two div elements “vertically stack” on one another by default?
Two div elements vertically stack on one another by default because div elements are block elements
What is the default flex-direction of an element with display: flex?
The default flex-direction of an element with display: flex is from left to right, in a row
What is the default value for the position property of HTML elements
The default position property for HTML elements is static
How does setting position relative on an element affect document flow?
How does setting position relative on an element affect where it appears on the page?