CSS Flashcards
What are the names of the individual pieces of a CSS rule?
- Selectors
2. declarations
In CSS, how do you select elements by their class attribute?
using the period symbol followed by the name of the class element you want selected
In CSS, how do you select elements by their type?
by matching the elements name
In CSS how do you select an element by its id attribute?
using a hash symbol followed by the name of the id
Name three different types of values you can use to specify colors in CSS
- RGB Values
- Hex Codes
- Color Names
What CSS properties make up the box model?
- content
- border
- margin
- padding
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 is a pseudo-class?
- class applied by the browser that is only applied in certain circumstances
- a keyword added to a selector that specifies a special state of the selected elements
- let you apply a style to an element not only in relation to the content of the doc tree but also in relation to external factors like history of the navigator (:vistor), status of its content (:checked) or the position of the mouse (:hover)
What are CSS pseudo-classes useful for?
- allow you to write less code
- style an element when user moves over it
- style visited and unvisited links differently
Name at least two units of type size in CSS
- pixels
- em/rem
- percentages
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?
nowrap
Why do two div elements “vertically stack” on one another by default?
because divs are block elements and take up the width of the full line.