CSS PROPERTIES
You can find a complete list of CSS Attributes/Properties at Microsoft.com or Blooberry.com. A tutorial for CSS can be found at W3Schools.com.
Some of the properties for various objects are:
FONT
TEXT
BLOCKLEVEL
BACKGROUND
CLASSIFICATON
UNITS
POSITION
OTHER NOTATIONS
are used as property:style with various HTML tags, e.g.
style="font-weight:bold"
<P style="font-weight:bold">
They also can be used in the <HEAD> of a single web page or as a style file like this:
|
<HTML>
<HEAD> <style type="text/css"> .lotsofstuff { font-weight:bold; font-style:italic; font-size:16px; letter-spacing:5; color:blue; } </style> </head> |
FONT
Use these FONT properties to specify the font size, style, family and weight.
| PROPERTY | VALUE |
| font-size |
|
| font-family |
The name of the font to be used. REMEMBER, if the surfer doesn't have the font on their PC, then their default font will be used. You can specify several fonts by using: font-family:verdana, arial, times new roman. The standard fonts that everyone should have on their PC are: times new roman, verdana, arial . |
| font-weight | normal, bold, bolder, lighter, 100 - 900 |
| font-style | normal, italic |
Use these properties to style text in a document:
| PROPERTY | VALUE |
| color |
|
| line-height |
|
| text-decoration |
|
| text-transform |
|
| text-align |
|
| text-indent |
|
Style sheets treat each block-level element (elements that start on a new line or some place new on the page) as if it were surrounds by a 'box'. The various properties of this 'box' can be assigned values.
| PROPERTY | VALUE |
|
margin-left margin-right margin-top margin-bottom margin |
This is the minimal distance between the border of the 'box' and any two adjacent elements within it.
|
|
paddint-top padding-right padding-bottom padding-right padding |
This is the minimal distance between the border of the 'box' and any elements within it.
|
|
border-width-top border-width-left border-width-bottom border-width-right border-width |
This is the width of the border, which can be a color, around the 'box'.
|
| border-style |
These are types of border and require no 'value', i.e. border-style:outset.
|
| border-color |
The color of the border.
|
| width |
The width of the element.
|
| float |
The alignment of the element. If float:left then other elements or text will wrap around the right side.
|
| clear |
This element specifies whether an element allows floating elements on it sides. More specifically, it lists side where float elements are not acceptable.
|
| position |
Usage: position:property:;sub-property:style
Example: <div style="position:absolute;left:150;top:150"><img src="graphic-file-name"></div> Properties:
|
The property defines the color of an element, i.e. the FOREGROUND color.
| PROPERTY | VALUE |
| background-image |
|
| background-color |
|
| background-attachment |
|
| background-position |
|
| background-repeat |
|
| PROPERTY | VALUE |
| display |
|
| list-style-type |
This list is displayed with the list-style-type:square.
|
| white-space |
This property determines how the 'white space' within an element is handled.
|
| PROPERTY | VALUE |
| length |
The value is an optional sign, '+' or '-', followed by a numerical value followed by a unit name.
There are three types of lengths:
|
| color |
|
POSITION
| Property | Description | Values |
|---|---|---|
| bottom | Specifies the bottom edge of an element | auto % length |
| clip | Sets the shape of an element. The element is clipped into this shape, and displayed | shape auto |
| left | Specifies the left edge of an element | auto % length |
| overflow | Sets what happens if the content of an element overflow its area | visible hidden scroll auto |
| position | Places an element in a static, relative, absolute or fixed position | static relative absolute fixed |
| right | Specifies the right edge of an element | auto % length |
| top | Sets how far the top edge of an element is above/below the top edge of the parent element | auto % length |
| vertical-align | Sets the vertical alignment of an element | baseline sub super top text-top middle bottom text-bottom length % |
| z-index | The z-index property sets the stack order of an element. An element with greater stack order is always in front of another element with lower stack order. Negative values can be used. | auto number |
style can be used as a property in any element, e.g. <UL style="font-size:15pt">
class is used to assign a particular style to an element, e.g. <UR>. It can also be used to define a style class, e.g H4.BOLD {font-weight:bold; }
id is used to individually name a style. Thus you could specify, within an element, a class and an id, e.g.
The <STYLE>, </STYLE> tags are used to specify style sheets elements, e.g. P, define CLASSes and IDs and to establish styles for a document.
The <LINK> tag is used to reference a document's style sheet elements to another document that contains only style sheet elements.
<SPAN>, <SPAN> are used to apply style sheet elements to specify text, e.g. <SPAN style="color:#CC0000; font-weight:bold; font-style:italic">This text will be bold, red, and italic.<SPAN> which will look like this
This text will be bold, red, and italic.
Comments in Style Sheets use a form that is similar to one used in C Programming Language. It is the "/* .... */". A typical comment could look like this:
CLASS
ID
<STYLE>
<LINK>
<SPAN>
COMMENT