CBTE162: Some Basic CSS Styles

Use these symbols for CSS
{ }   :   ;
{ } Use the curly brace to hold the entire set of styles per selector in the Document Styles.
: colon after the property
; semi-colon after the end of the value

These CSS styles can be used for these Elements or Selectors: body, div, h1 - h6, p
This is not a complete list of CSS available

SelectorPropertyValueDescription

body

div

h1

h2

h3

h4

h5

h6

p

background-colorColor Name or Hex code Give a background color to an entire web page, a specific h or p
colorColor Name or Hex code Specifiy the font color
text-alignleft
center
right
Specify the text alignment
EXAMPLE:   body {background-color: #660066; color: #ffffff; }
Some CSS Border Styles
border-color color name
or Hex code
Default is black
border-type solid
dotted
dashed
double
Some options for the border types
border-weight px weight Give a specific weight to border
border color
type
weight
Call out all three listed above in shorthand. Gives a border all around object.
EXAMPLE:   border: dotted red 5px;
border-topcolor
type
weight
Individual borders per side, list all three as above.
border-rightcolor
type
weight
 
border-bottomcolor
type
weight
 
border-leftcolor
type
weight
 
Some CSS Font Styles
font-familyserif
sans-serif
Call out a different font than the default font. See link to list below
font-sizepx amount Give a specific size other than default
font-styleitalic  
font-weightbold
normal
 
A few Extra CSS Styles
letter-spacingpx amount Add spacing between letters of a word - Use sparingly
line-height% Add spacing between lines of type (leading). Default is 120%.
width% or
px amount
Add a specific width to a selector

Useful Links

List of HTML Color Names & Hex Codes Supported by Browsers

Some Basic Fonts for Mac & PC