Here's where we put everything together. This is a list of what "CSS - Madness or Magic?" and "History On-Line" cover. It is, by no means, a complete list, but it will get you started in using CSS.
There are times when I will have [information] enclosed in square brackets. Neither the brackets nor the contents of the brackets are to be included in the CSS information. I use that format to show that there is more than one choice for a particular CSS property. I will also use the # symbol for the same purpose. If you're unsure of how a property is supposed to be written, section title will take you to the appropriate place in either "CSS - Madness or Magic?" or "History On-Line".
Horizontal values are calculated first, then vertical values. If only one value is given, it is applied to the horizontal position. Vertical positioning is assumed to be 50% or "center". Numerical values may be combined. { background-position: 75% 126px; } will put the image three-quarters of the way across the page and 126 px from the top of the screen. Negative values are permitted for positioning, and keywords cannot be combined with any of the numerical values.
|
The "Content" (red area) is the area of the text (including the space between the rows of text) or image. "Content" can be an entire page or a section of the page. The "Padding" (light green area) is the space between the content and the border. The "Border" (dark green line) is a line or set of lines, drawn around the padding and may be visible or invisible. The "Margin" (blue area) in an invisible line enclosing the entire element or block. Margins, padding and borders are always set in the following order: top, right, bottom, left. Only margins may be set to negative widths. |
The thickness of the borders using the keyword method (thin, medium, thick) depends on the browser and resolution settings.
If no border-style is selected, the style is assumed to be "none", and the border-width value will be forced to 0. Not all browsers recognize all these border styles. Some only recognize "none" and "solid". The shorthand version { border-style: [style]; } works in the same manner as the { margin: ####;} property.
The information I've given you here is only a small portion of what CSS can do. Further information can be found in a multitude of places on the Internet, but my favourite places are: