CSS Flashcards
(39 cards)
Name three different types of values you can use to specify colors in CSS.
RGB, Hexidecimal, Color name
What 5 CSS properties make up the box model?
Margin, Padding, Width, Height, Border
Which CSS property pushes boxes away from each other?
margin
Which CSS property adds space between a box’s content and its border?
Padding
What are the names of the individual pieces of a CSS rule?
Selector and a declaration
In CSS, how do you select elements by their class attribute?
by using a period ( . )
In CSS, how do you select elements by their type?
By typing the matching element name.
In CSS, how do you select an element by its id attribute?
By using a ( # ) symbol.
What is a pseudo-class?
a keyword added to a selector that specifies a special state of the selected element(s).
What are CSS pseudo-classes useful for?
pseudo-classes allow us to apply styling based on user interaction or the structure of the HTML document
Name two types of units that can be used to adjust font-size in CSS.
pixels, rem
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
Row
What is the default flex-wrap of a flex container?
No wrap
Why do two div elements “vertically stack” on one another by default?
Because they are block-level elements
What is the default flex-direction of an element with display: flex?
Row
What is the default value for the position property of HTML elements?
static
How does setting position: relative on an element affect document flow?
it doesn’t affect the document flow
How does setting position: relative on an element affect where it appears on the page?
it sits right where it’s supposed to be. Like normal flow
How does setting position: absolute on an element affect document flow?
it is no longer a part of normal document flow
How does setting position: absolute on an element affect where it appears on the page?
it will appear at the top left corner of the nearest ancestor element that is not static
How do you constrain an absolutely positioned element to a containing block?
set position: not static;
What are the four box offset properties?
top, right, bottom, left
What does the term “source order” mean with respect to CSS?
the order that your CSS rules are written in your stylesheet.