Dr. Greg Bernstein
August 18, 2020
CSS values and units. Important.
Styling Lists. Just a bit.
Styling Links. The section on links as buttons.
Absolute Units
Pixels (px
) are referred to as absolute units because they will always be the same size regardless of any other related settings.
mm
, cm
, in
: Millimeters, centimeters, or inches.
pt
, pc
: Points (1/72 of an inch) or picas (12 points.)
Relative Units
em
: 1em is the same as the font-size of the current elementrem
: The rem (root em) works in exactly the same way as the em, except that it will always equal the size of the default base font-sizevw
, vh
: Respectively these are 1/100th of the width of the viewport, and 1/100th of the height of the viewport.You can also use percentage values to specify most things that can be specified by specific numeric values. This allows us to create, for example, boxes whose width will always shift to be a certain percentage of their parent container’s width.
body {
width: 70%
}
red
, green
there are a ton#e0b0ff
. Your browser dev tools can help with these.rgb(255,0,0)
hsl(0,100%,50%)
rgba(255,0,0,0.5)
hsla(240,100%,50%,0.5)
opacity
propertylist-style-type
: Sets the type of bullets to use for the list, for example square or circle bullets for an unordered list, or numbers, letters or roman numerals for an ordered list.list-style-position
: Sets whether the bullets appear inside the list items, or outside them before the start of each item.list-style-image
: Allows use a custom image for the bullet, rather than a simple square or circle.line-height
is very usefull.start
: Just what you think…reversed
: Just what you think…value
: Allows you to set specific numbers to <li>
s.:visited
pseudo class.:hover
pseudo class.:focus
pseudo class.:active
pseudo class.