The style element is in the documents head tags. You can use a link tag to link multiple pages to the same style sheet. You can also use a style tag for each page individually. Whichever element is placed after the other will override.
The rules are applied to elements within curly brackets. You can also name an element and apply a rule more specifically with a format like element.name
Margins represent the space around an element. Can be a percentage of the window size, measured in pixels, or em. Em is a measure equal to the height of a font character.
Padding is the space around contents within an element. If an element inside an element with padding set also has a margin, the space around it will be a sum of the two.
Fonts can change style, size, weight, and family. Browsers may have different font family's available but this short list that is universal. You can set font family to a list in preference order.
An element with a border should also have a width property (=100%) due to how some browsers place the right margin too far.
Some border types are dotted, dashed, solid, double, groove, ridge, inset and outset
Here is an example of what a thin, solid border looks like.
You can assign a background color to an element and get an effect like this. If you don't set a border property some browsers only show the background color behind each character.
There are 16 named colors that work with most browsers:
Here is a graphic showing the hex codes showing more colors compatible with most browsers:
Some browsers cannot render CSS. In order to ensure maximum compatability you can set the style in the BODY tag using the following elements. You can also set background color in a table and it's cells:
Wrap the font tag around some text where you would like to see changes to the font. The face element changes the font family.
Avoid using text in the body of your webpage that isn't wrapped in a block-level element such as p. Some browsers don't reneder plain text as expected.
Always set the font of the pre element to monospace as some browsers do not use a fixed-width font for this element.
Set the font family on headings p, headings, and ul elements if you will be setting borders or backgrounds on elements such as div. In these cases, some browsers forget to use the inhereted font family and will switch to a default.
You can change the color of a link, a (:link) or one that's been visited (:visited), active (:active) or whenever the mouse pointer is hovering over it (:hover)