Lecture08 1
Lecture08 1
Name Description
font-family Font face (mdn)
color Font color (and always font color) (mdn)
font-size Font size (mdn)
line-height Line height (mdn)
text-align Alignment of text (mdn)
More font-related CSS
Name Description
text-decoration Can set underline, line-through
(strikethrough) or none (e.g. to unset
underline on hyperlinks) (mdn)
text-transform Can change font case, i.e. uppercase,
lowercase, capitalize, none (mdn)
font-style Can set to italic or normal (e.g. to
unset italic on <em>) (mdn)
font-weight Can set to bold or normal (e.g. to unset
bold on h1 - h6) (mdn)
letter-spacing Controls the space between letters (mdn)
Flexbox
Review: Flexbox
This initial width* of the flex item is called the flex basis.
This initial width* of the flex item is called the flex basis.
The explicit width* of a flex item is respected for all flex items,
regardless of whether the flex item is inline, block, or inline-
block.
*width in the case of rows; height in
the case of columns
Flex basis
flex-shrink:
- If set to 1, the flex item shrinks itself as small as it can in
the space available.
- If set to 0, the flex item does not shrink.
The width* of the flex item can automatically grow larger than
the flex basis via the flex-grow property:
flex-grow:
- If set to 1, the flex item grows itself as large as it can in the
space remaining.
- If set to 0, the flex-item does not grow.
Let's unset the height and width of our flex items again:
flex-grow example
OUTPUT
CSS
(Codepen)
Viewport?
Browser vocabulary:
- viewport: the rectangle where the webpage shows up,
scrollable via a scrollbar
- chrome: all the UI that's not the webpage, i.e.
everything but the viewport
Viewport?
Browser vocabulary:
- viewport: the rectangle where the webpage shows up,
scrollable via a scrollbar
- chrome: all the UI that's not the webpage, i.e.
everything but the viewport
The
viewport
Viewport?
Browser vocabulary:
- viewport: the rectangle where the webpage shows up,
scrollable via a scrollbar
- chrome: all the UI that's not the webpage, i.e.
everything but the viewport
The chrome
vh and vw
Example:
- height: 100vh;
- width: 100vw;
Flexbox example, solved
HTML
CSS
Note: Using border-box will include padding in the width and height as well.
Note: You cannot select padding-box or margin-box.
Fixed example