What Is CSS?
HTML offers extensive text formatting options. CSS, or Cascading Style Sheets, goes further: it can define global page templates or change the style of a single letter, including its colour, font and size. This flexibility is its most important feature.
A well-designed website usually uses a few harmonious colours and fonts. Instead of repeating them on every page, we can define them once in CSS and use them across the website. Updates then no longer require changing dozens of pages.
CSS can be written inside HTML, in the body or head depending on its type. Alternatively, external CSS files can be linked from the HTML document as needed.
Microsoft Internet Explorer and Firefox interpret some CSS differently. It is best to write code that both browsers interpret in the same or a similar way.
LINK PROPERTIES
a: The link's state when the page opens, before clicking or hovering.
a:hover : The link's state when the pointer hovers over it.
a:active : The link's state at the moment it is clicked.
a:visited : The link's state after it has been clicked. FORMATTING:
color: Sets the link colour.
background-color: Sets the link background colour.
background-image: Adds a background image to the link; this may also be an animated GIF.
text-decoration: Sets whether the link is underlined, overlined or otherwise decorated.
font-weight: Sets the thickness of the text.
border: Adds a border around the link.
display: Selects the display area containing the link, such as a cell or row.
LIST PROPERTIES
disk: Displays list markers as filled circles.
circle : Displays list markers as circles.
square : Displays list markers as squares.
decimal : Displays list markers as numbers.
lower-roman : Uses lowercase Roman numerals such as i, ii and iii.
upper-roman : Uses uppercase Roman numerals such as I, II and III.
lower-alpha : Uses lowercase letters such as a, b and c.
upper-alpha : Uses uppercase letters such as A, B and C.
none : Removes list markers.
inside : Makes the second line of a list item start at the far left.
Outside : Makes the second line of a list item start at the same point as the first.
list-style-image : Uses an image as the list marker.
LAYER PROPERTIES
position: Sets the position of the layer.
absolute: Positions the layer relative to the window.
relative: Positions the layer relative to the previous layer.
static: Sets a static layer position, with the top left corner as the default.
top: Sets the layer's offset from the top.
left: Sets the layer's offset from the left.
width: Sets the layer width.
height: Sets the layer height.
overflow: Controls content that does not fit within the specified height and width.
auto: Determined automatically.
scroll: Displays the content with a scrollbar.
visible : Displays content overflowing the layer's specified dimensions.
hidden: Hides overflowing content.
visibility: Sets the layer's visibility.
visible : Makes the layer visible.
hidden: Hides the layer.
z-index : Sets the stacking order of layers from bottom to top. A value of 1 places the layer at the bottom.
FONT PROPERTIES
font-family: Sets the typeface, such as Arial or Verdana.
font-style: Sets normal or italic text.
font-variant: Sets normal text or text made up of capital letters.
font-weight: Sets the font weight.
font-size: Sets the font size.
TEXT PROPERTIES
word-spacing : Sets the spacing between words.
letter-spacing : Sets the spacing between letters.
text-decoration : Sets whether words are underlined, overlined or otherwise decorated.
underline : Underlines the word.
overline : Draws a line above the word.
line-through : Draws a line through the word.
blink : Makes the word blink, for Netscape.
vertical-align : Sets horizontal text alignment.
text-transform: Sets uppercase or lowercase text.
capitalize : Capitalizes the first letter of each word.
uppercase : Makes all letters uppercase.
lowercase : Makes all letters lowercase.
none : Preserves the text's original letter case.
text-align: Sets vertical text alignment.
left : Aligns text to the left.
right : Aligns text to the right.
center : Centers the text.
justify : Justifies the text.
text-indent : Sets the left indentation of the first line.
line-height : Sets line height. Larger values increase the space between lines.
first-line : Formats the first line of text.
first-letter : Formats the first letter of text.
CURSOR PROPERTIES
crosshair: Displays the cursor as a crosshair.
auto: Displays a text cursor over text and a normal arrow over empty space.
default: Displays a normal arrow over both text and empty space.
hand: Displays a hand cursor, as for links.
move: Displays a move cursor.
ne-resize: Displays an arrow pointing diagonally to the right.
nw-resize: Displays an arrow pointing diagonally to the left.
se-resize: Displays an arrow pointing down and right.
sw-resize: Displays an arrow pointing down and left.
n-resize: Displays a thin upward-pointing arrow.
s-resize: Displays a thin downward-pointing arrow.
w-resize: Displays a thin left-pointing arrow.
e-resize: Displays a thin right-pointing arrow.
text: Displays a text cursor over both text and empty space.
wait: Displays the busy animation.
help: Displays a help cursor with a question mark.
BACKGROUND PROPERTIES
background-color: Sets the background colour.
#color : Colour name.
transparent: Makes the background transparent.
background-image: Places an image in the background.
url : The address of the background image.
background-repeat: Sets how the background image repeats.
repeat : Repeats the image across the entire background.
repeat-x : Repeats the image horizontally from the top left.
repeat-y : Repeats the image vertically from the top left.
no-repeat: Displays the image once at its original size.
background-attachment: Sets how the background image behaves when scrolling.
scroll : Makes the background scroll with the page.
fixed: Keeps the background fixed when the page scrolls.
background-position: Positions the background image as required.
top : Places the image at the top.
center : Centers the image.
bottom : Places the image at the bottom.
left : Places the image on the left.
right: Places the image on the right.
…px : Sets the image's offset from the left.
TABLE PROPERTIES
margin : Sets the spacing between the table and the window edges.
margin-top : Sets the spacing between the table and the top window edge.
margin-right : Sets the spacing between the table and the right window edge.
margin-bottom : Sets the spacing between the table and the bottom window edge.
margin-left : Sets the spacing between the table and the left window edge.
padding : Sets the spacing between table borders and content.
padding-top : Sets the spacing between the top table border and content.
padding-right : Sets the spacing between the right table border and content.
padding-bottom : Sets the spacing between the bottom table border and content.
padding-left : Sets the spacing between the left table border and content.
border : Styles the table borders.
border-top : Styles the top table border.
border-left : Styles the left table border.
border-bottom : Styles the bottom table border.
border-right : Styles the right table border.
border-width : Sets the table border width.
border-top-width : Sets the top table border width.
border-right-width : Sets the right table border width.
border-bottom-width : Sets the bottom table border width.
border-left-width : Sets the left table border width.
border-style : Sets the table border style.
border-top-style : Sets the top table border style.
border-right-style : Sets the right table border style.
border-bottom-style : Sets the bottom table border style.
border-left-style : Sets the left table border style.
border-color : Sets the table border colour.
border-top-color : Sets the top table border colour.
border-right-color : Sets the right table border colour.
border-bottom-color : Sets the bottom table border colour.
border-left-color : Sets the left table border colour.
color : Sets the colour of text in the table.
width : Sets the table width.
height : Sets the table height.
NOTE: Although this section is titled TABLE, these properties can be used with almost any element, including TD, TR and TH. This is what makes CSS special.
SCROLLBAR PROPERTIES
scrollbar-face-color : The scrollbar face colour also affects its background.
scrollbar-base-color : Colours the scrollbar's left and top borders as lines.
scrollbar-shadow-color : Shadow colour for the right and bottom borders.
scrollbar-highlight-color : Shadow colour for the left and top borders; also affects the background.
scrollbar-arrow-color : Colour of the direction arrows.
These scrollbar properties apply only to Internet Explorer.


