您的位置:寻梦网首页编程乐园CSS 初步Cascading Style Sheets Index
Style Sheets
FLOATING ELEMENT PROPERTY:
 CLEAR
 FLOAT
 HEIGHT
 WIDTH


CLEAR : NONE | LEFT | RIGHT | BOTH }

Inherited: No

The CLEAR property prevents a floating element from appearing with the specified areas of a text.

NONE

The NONE value allows a floating element to appear on both sides of a text.

LEFT

The LEFT value prevents a floating element from appearing on the left side of a text.

RIGHT

The RIGHT value prevents a floating element from appearing on the right side of a text.

BOTH

The BOTH value prevents a floating element from appearing on both the left and right sides of a text.

Code:
Selector {CLEAR:  NONE}
Selector {CLEAR:  LEFT}
Selector {CLEAR:  RIGHT}
Selector {CLEAR:  BOTH}


FLOAT : LEFT | RIGHT | NONE }

Inherited: No

The FLOAT property allows you to determine where an image will appear within a text or element.

Image and text elements that appear embedded within a text or another element are called floating elements.

LEFT

The LEFT value embeds the image within the text and places the left edge of the image on the left side of the text.

RIGHT

The RIGHT value embeds the image within the text and places the right edge of the image on the right side of the text.

NONE

The NONE value allows the image to simply appear where it occurs within a text.

Code:
Selector {FLOAT:  LEFT}
Selector {FLOAT:  RIGHT}
Selector {FLOAT:  NONE}


HEIGHT : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The HEIGHT property allows you to set the height of an element of text or an image. For example, you could embed an image into a specified position within a text using the FLOAT property. Then use the HEIGHT and/or WIDTH properties to specify an exact size for the image. If you set the HEIGHT of an element to a specified value and set the WIDTH property to AUTO, the element will be scaled proportionally (i.e., you maintain the aspect ratio).

LENGTH

The LENGTH value can be in any of the following seven dimensions. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total height being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the height. If both the WIDTH and HEIGHT are set to AUTO, the dimensions of the text or image element remains unchanged. By declaring AUTO, you can ensure that any previous declaration will not effect the height of the selected element.

Code:
Selector {HEIGHT:  150MM}
Selector {HEIGHT:  2.85IN}
Selector {HEIGHT:  45PC}
Selector {HEIGHT:  36PT}
Selector {HEIGHT:  50%}
Selector {HEIGHT:  AUTO}
Selector {
HEIGHT:  3.0IN
WIDTH: AUTO
}


WIDTH : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The WIDTH property allows you to set the width of an element of text or an image. For example, you could embed an image into a specified position within a text using the FLOAT property. Then use the WIDTH and/or HEIGHT properties to specify an exact size for the image. If you set the WIDTH of an element to a specified value and set the HEIGHT property to AUTO, the element will be scaled proportionally (i.e., you maintain the aspect ratio).

LENGTH

The LENGTH value can be in any of the following seven dimensions. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total width being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the width. If both the WIDTH and HEIGHT are set to AUTO, the dimensions of the text or image element remains unchanged. By declaring AUTO, you can ensure that any previous declaration will not effect the width of the selected element.

Code:
Selector {WIDTH:  150MM}
Selector {WIDTH:  2.85IN}
Selector {WIDTH:  45PC}
Selector {WIDTH:  36PT}
Selector {WIDTH:  50%}
Selector {WIDTH:  AUTO}
Selector {
WIDTH:  3.0IN
HEIGHT: AUTO
}

Copyright 1999 by Infinite Software Solutions, Inc.
Trademark Information