CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector, declaration, property and value.
In CSS, how do you select elements by their class attribute?
period before matching class name. .classname
In CSS, how do you select elements by their tag name?
matches tag/element name. elementName
In CSS, how do you select an element by its id attribute?
hashtag before matching id name. #idname
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, padding, border, margin
Which CSS property pushes boxes away from each other?
margin
Which CSS property add space between a box’s content and its border?
padding
display: inline for a list (block) element?
removes bullets/numbers
What is a pseudo-class?
keyword added to a selector that specifies a special state of the selected element
What are CSS pseudo-classes useful for?
allows change of appearance of elements when user is interacting with them. it allows elements to respond to users.
Name examples of pseudo-classes
:hover, :active, :focus :link :visited :nth-child()
What is :nth-child()?
matches elements based on their position among a group of siblings.
Name two types of units that can be used to adjust font-size in CSS.
px, percentages, em
What CSS property controls the font used for the text inside an element?
font-family to specify typeface
font-size
font-weight (bold)
font-style (italic)
What is the default flex-direction of a flex container?
row
What is the default flex-wrap of a flex container?
nowrap
Flexbox: display. parent or child property? What is the value for display for a flexbox.
parent. value: flex
Flexbox: order. parent or child property?
child
Flexbox. flex-direction. parent or child property? Name the values for flex-direction.
parent. values: row, row-reverse, column, column-reverse