CSS Flashcards
- {}
target all the element on the page
what is “selector” and what is “delectation”?
xx {???}
xx is the “selector” and ??? is the “delectation”
what is “property” and what is “value”?
h1,h2 { font-family: xxx; color: ???}
font-family and color is the “property”
xxx and ??? is the “value”
declaration block
a set of rules, code
xxx {} is class or id?
(#) is ID
. is Class
.xxx {} is a class or id?
. is class
(#) is id
- {} mean?
universal selector
target all elements on the page
h1, h2, h3 {} means the css rule for which selector?
Type selector
target h1, h2, h3 elements
body {
font-family: roboto, sans-serif, helvetica}
sans-serif in here means a *fallback value.
When font style roboto is not available , sans-serif will apply.
sans fails, helvetica
always set font family with two type.
Mac for roboto
Win for sans-serif
rgb(red,green,blue)
hul(x,x,x)
they are css function
x.?? {} means the css rule for which selector?
a class selector.
means all the x with ?? class
xx>?? {} means the css rule for which selector?
Child selector
target any ?? that are the children of xx (but no other ?? in the page)
x(blank space)? {} means the css rule for which selector?
x ? {}
Descendant selector
target any ? elements that are sit inside the x element
x+? {} means the css rule for which selector?
ADJACENT SIBLING SELECTOR
target the first ? element right after x element (but not other x elements)
x~? {} means the css rule for which selector?
General SIBLING SELECTOR
target all the ? elements after x elements
rem
2rem means 200% of html initial value (which is 16px, can be adjust by css)
3 rem means 300%
em
2em means 200% of parent value
<div font-size 16px
cross axies (align-items)
top to bottom
main axies(justify-content)
left to right
align-items to control the single row in flexbox
aligh-content control all the rows in flexbox
box-sizing: content -box
content keeps the same size, just add width and height according to the padding, border, margin.
box-sizing: border-box
content will shrink for the space for padding, border, margin.
row
a vertical space. every line
column
a horizontal space left to right, a small part of row