CSS Flashcards
(40 cards)
what are the individual pieces of a css rule?
css selector (element, class, id, etc), declaration block; within declaration block is property and value
how to select elements by their class attribute?
.class-name {}
how to select elements by their type?
element-name {}
How to select elements by their id?
id-name{}
Three different types of values to choose color in CSS
hexcode, rgb(), hsla, prebaked css color
how do you link a css stylesheet to an index html?
link href=”location-of-stylesheet.css” rel=”stylesheet” type=”text/css”
What is a descendant combinator selector and how do you use it?
selects all elements that are descendants of the first element.
parent-element “ [single space] “ child-element {}
What is a child combinator selector and how do you use it?
only uses direct children of the parent element.
parent-element > child-element {}
what css properties make up the box model?
margin, padding, border
which css property pushes boxes away from each other?
margin
what css property adds space between a box’s content and its border?
padding
what is a pseudo class?
a selector that targets an element in a certain state (being hovered, active, focus)
what are pseudo-classes useful for?
for selecting targets in a certain state and applying additional properties (e.g. changing the color of a button when hovered)
2 types of units that can be used to adjust font-size
rem, em , px size
what css property controls font used for text?
font-family
What is a fall-back value for fonts?
backup font a browser typically has in case that browser or program does not have that font initially specified (typically serif/sans-serif)
Difference between sans-serif and serif?
serifs are the extra little flare at the end of letters (e.g. times new roman), refer to all fonts with it , sans-serif do not have the serif (arial)
What is the default direction of flex-box?
flex-direction: row
what is the default flex-wrap of a flex container?
no-wrap
what is the difference between justify content and align items?
same thing along different axes
difference between align items and align content
align items affects the single row that all the flex children are in, align content affects all the rows inside the larger container.
why do two div elements vertically stack on each other?
because they are block level elements; their width is automatically set to 100% of the page so the next block element is automatically bumped below
What is the default value for the position property of the HTML elements
static
How does setting position:relative on the element affect document flow
does not change document flow