This section summarizes the five style properties of supported by Cascading Style Sheets. Scroll through the file or click on one of the style properties below.
by DEVX Staff
Jan 1, 2000
he symbol
means that the style property is not supported by Netscape Navigator 4.0.
The symbol
means that the style property is not supported by Internet Explorer 3.0.
The symbol
means that the style property is not supported by Internet Explorer 4.0.
If the symbol has an * after it, that means that the style property is only partially supported. Those values with a corresponding asteryx in front of them are the ones that don't work.
NOTE: Netscape 4.0 does NOT support classes defined in the style declaration in the header when you set the class as a number, i.e. p.1 {font-size: 15pt} but it will work if the class is a letter. Don't ask.
Netscape versions 3.0 and earlier support no style sheets. Keep in mind, though, that these discrepancies are contantly changing. Furthermore, the limitations that we list here are only the result of some preliminary testing on our part, and may not be correct in every case. P>
Displays the image "sand.gif" in the background area of the blockquote and repeats the image vertically and horizontally to fill the entire background area.
background-attachment
Lets you attach the background image so that it doesn't scroll.
Displays the image "sand.gif" in the background area of the blockquote and prevents the image from scrolling.
background-position
Sets the initial position of the background image.
vertical % horizontal %
top center bottom left center right
body {background-image: url(..images/sand.gif); background position: center center}
Centers the background image vertically and horizontally on the initial body screen.
Placement Properties
General Comments: These properties let you specify where an element gets placed within its "box."
Property
Description
Values
Example
margin-top
**
Places the top margin of the element; you can use negative values.
**NOTE: For some reason, IE4.0 treats this style command like Netscape 4.0 treats the padding properties, i.e. it will add space to the top of every cellif done with a table. With <div> the property works normally.
XX units % auto
div {margin-top: 2em}
Displays the top margin of the division 2 em spaces down the page.
margin-bottom
**
Places the bottom margin of the element; you can use negative values.
**See the note for margin-top
XX units % auto
div {margin-bottom: 10%}
Places the bottom margin of the div element 10 percent down the page and diplays the element from the bottom up.
margin-left
Places the left margin of the element; you can use negative values.
XX units % auto
div {margin-top: 6em}
Displays the left margin of the division 6 em spaces from the left of the page.
margin-right
Places the right margin of the element; you can use negative values.
XX units % auto
div {margin-right: 1em}
Displays the right margin of the division 1 em space from the right edge of the page.
padding-top
Inserts padding at the top of the element. (Theoretically. We have only been able to make padding-top along with its related properties, work with tables.)
XX units % auto
Table {padding-top: 12pt}
Inserts 12 points of space at the top of every cell in the table.
padding-bottom
Inserts padding at the bottom of the element.
XX units % auto
Table {padding-bottom: 12pt}
Inserts 12 points of space at the bottom of every cell in the table.
padding-left
Inserts padding along the left side of the element.
XX units % auto
Table {padding-left: 2em}
Inserts 2 em spaces at the left margin of every cell in the table.
padding-right
Inserts padding along the right side of the element.
XX units % auto
Table {padding-right: 2em}
Inserts 2 em spaces at the right margin of every cell in the table.
A quick note about tables and the following border properties. As far as we could tell, only IE 4.0 would support border styles with its tables. However, the way it supported the tags is far from intuitive. If you put a border around a table, say table {border: thick double red} then the resulting table in IE4.0 will have a double thick red border around it and a double thick border, though not red, around each cell in the table. So, the table cells themselves only copy the width and style properties of the table property, not the color. The same thing happens when you specify a property for indivdual rows. That is, the width and style can be changed for the entire row, but for some reason, the color cannot be changed. Finally, in a surprising turn of events, using individual properties for table data works very well. In other words, td.a {border: thin double red} creates a nice double red border around any particular cell with class=a. Once again, though, this only works in IE4.0.
border-width
**
Sets the width of the element's border.
**NOTE: for some reason, the straight border-width tag does not produce a border in IE4.0. Other combinations of tags do, though.
Sets the width, color, and style of the border simultaneously
width value style value color value
table {border: thick double red}
Displays a thick, double, red border around the table.
table {border-top: thin dashed red}
Diplays a thin, dashed, red border at the top of the table.
height
**
Sets the height of the element.
**Note: We have had limited success (with Netscape; no success in IE3.0) applying width and height to <div> tags, and no success with images.
XX units
img.button {height: 70px}
Sets all button class images to be 70 pixels high.
width
**
Sets the width of the element.
** See note for height.
XX units
img.button {width: 100px}
Sets all button class images to be 100 pixels wide.
float
Places the element to the left or right and flows text around it.
right left none
img.button {float: left}
Places a button class image to the left margin and flows text around it.
clear
Prevents text from flowing around an element.
right left none
img.button {clear: left}
Places a button class image to the left margin and prevents any text or other elements from flowing beside it.
Classification Properties
General Comments: These properties let you classify elements by object type and assign characteristics based on these object types.
Property
Description
Values
Example
display
Specifies the category of object an element belongs to: a block element, like a heading or paragraph; an inline element, like emphasis or anchors; or a list-item element. If the category is none, the content of the element should not be displayed at all.
none ""
block inline list-item
p {display: none}
Hides the content of the paragraph.
p {display: ""}
Display the contents of the paragraph.
p {display: block}
Treats the paragraph as a block element, which can be positioned separately using the positioning attributes.
white-space
Describes how white space should be handled within the block elements.
normal pre nowrap
p {white-space: no-wrap}
The paragraph will break only with a specific <br> tag.
list-style-type
Sets the type of symbol that appears in front of a list item.
disc circle square decimal lower- roman upper- roman lower- alpha upper alpha
ul {list-style-type: square}
Unordered list items will use a square bullet.
list-style-image
Selects a specific image to serve as a bullet in front of list items.
url(URLname)
ul {list-style-image: url(../images/smiley.gif)}
Unordered list items will use the image "smiley.gif" as a bullet.
list-style-position
Describes how the bullet marker and text in a list line up with each other.
inside outside
ul {list-style-position: outside}
Creates the effect of a hanging indent
ul {list-style-position: inside}
The bullet and the second line of text are flush left.