CSS Flashcards
pseudo selector
Pseudo-classes are appended right after the main selector with a colon
box model
content => padding => border => margin
CSS box model calculates the total width and height of the element by taking padding and border values into account like so:
display: inline
default behavior take as much space as in need
cant set with
display: block
break into new line, can set width
display: inline-block
behavior of both inline and block, it can be set width but also display inline next to each other
position:static;
which means that they aren’t positioned at all,
element take space one after the other
position: relative
like position static but take up space as it needs, left, right, top, bottom
refer to the original position of the element
position: absolute
When you position an element absolutely, it no longer takes up the space it used to and is now essentially ‘floating’ on your screen, above the surrounding elements.
flexbox
designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities (either row or column)
grid
two dimensional structure that also offer space distribution and alignment using cols and rows