CSS Flashcards
(46 cards)
What are the names of the individual pieces of a CSS rule?
selector {declaration} declaration = (property:) (value)
In CSS, how do you select elements by their class attribute?
using the .class selector
In CSS, how do you select elements by their tag name?
just using the tag type
In CSS, how do you select an element by its id attribute?
using the #id selector
What CSS properties make up the box model?
margin, padding, border, height, width
Which CSS property pushes boxes away from each other?
Margin
Which CSS property add space between a box’s content and its border?
padding
Name three different types of values you can use to specify colors in CSS.
rgba, rgb, hexcode, color
What is a pseudo-class?
Class that comes from a special state. under the browser’s control. You can prepare for them but not control them.
What are CSS pseudo-classes useful for?
they make things easier as they allow interaction with the user.
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?
div elements are block elements and take up the entire row
What is the default flex-direction of an element with display: flex?
row
What are the three primary components of a page layout? (Which helper classes do you need?)
container, column, row
What is the minimum number of columns that you should put in a row?
1
What is the purpose of a container?
boundary of content
What is the default value for the position property of HTML elements?
static
How does setting position: relative on an element affect document flow?
no effect on document flow. like a out of body feeling.
How does setting position: relative on an element affect where it appears on the page?
move relative where it would normally exist if static.
How does setting position: absolute on an element affect document flow?
it affects it as if it doesn’t exist.
How does setting position: absolute on an element affect where it appears on the page?
absolutes are taken off of the page entirely so it finds an environment to exist in so it’s looking for any position layout.
How do you constrain an absolutely positioned element to a containing block?
its positioned against its first non static ancestor, But if not found, it positioned against page.
What are the four box offset properties?
top, bottom, left, right.