CSS Flashcards
CSS - SYNTAX
What are the names of the individual pieces of a CSS rule?
selector, declaration blocks, property, values
CSS - SYNTAX
In CSS, how do you select elements by their class attribute?
put a period before the element
CSS - SYNTAX
In CSS, how do you select elements by their type?
just the element
CSS - SYNTAX
In CSS, how do you select an element by its id attribute?
put a # before the element name
CSS-COLORS
Name three different types of values you can use to specify colors in CSS.
- the name of the color
- # FFFFFF;
- rbg(0,0,0)
CSS-BOX-MODEL
What CSS properties make up the box model?
padding, border, margin
CSS-BOX-MODEL
Which CSS property pushes boxes away from each other?
margin
CSS-BOX-MODEL
Which CSS property adds space between a box’s content and its border?
padding
CSS-PSEUDO-CLASS
What is a pseudo-class?
is a class applied by the browsers under certain circumstances
CSS-PSEUDO-CLASS
What are CSS pseudo-classes useful for?
- a class that allows users to change the appearance when interacting with elements.
- makes CSS easier by not having to apply certain classes to each individual element.
CSS-FONTS
Name two types of units that can be used to adjust font-size in CSS.
pixels and rems
CSS-FONTS
What CSS property controls the font used for the text inside an element?
font-family property
CSS-FLEXBOX
What is the default flex-direction of a flex container?
row
CSS-FLEXBOX
What is the default flex-wrap of a flex container?
nowrap
CSS-LAYOUT-CLASSES
Why do two div elements “vertically stack” on one another by default?
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 should containers classes alway have?
max-width: px
margin: 0 auto
CSS-LAYOUT-CLASSES
What should row classes alway have?
display: flex
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?
it doesnt
CSS-POSITIONING
How does setting position: relative on an element affect where it appears on the page?
only use if you want to move things slightly to the left, right, down or up
CSS-POSITIONING
How does setting position: absolute on an element affect where it appears on the page?
sticks to the closest ancestry that is non-static
CSS-POSITIONING
How do you constrain an absolutely positioned element to a containing block?
change the ancestor element, parent div has to be other than static
CSS-POSITIONING
What are the four box offset properties?
top, bottom, left, right