CSS Classification Properties
Display
| Syntax: | display: <value> |
|---|---|
| Possible Values: | block | inline | list-item | none |
| Initial Value: | block |
| Applies to: | All elements |
| Inherited: | No |
The display property is used to define an element with one of four values:
- block (a line break before and after the element)
- inline (no line break before and after the element)
- list-item (same as block except a list-item marker is added)
- none (no display)
Each element typically is given a default display value by the browser, based on suggested rendering in the HTML specification.
The display property can be dangerous because of its ability to display elements in what would otherwise be an improper format. The use of the value none will turn off display of the element to which it is assigned, including any children elements!
Whitespace
| Syntax: | white-space: <value> |
|---|---|
| Possible Values: | normal | pre | nowrap |
| Initial Value: | normal |
| Applies to: | Block-level elements |
| Inherited: | Yes |
The white-space property will determine how spaces within the element are treated. This property takes one of three values:
- normal (collapses multiple spaces into one)
- pre (does not collapse multiple spaces)
- nowrap (does not allow line wrapping without a <BR> tag)
List Style Type
| Syntax: | list-style-type: <value> |
|---|---|
| Possible Values: | disc | circle | square | decimal | lower-roman | upper-roman
| lower-alpha | upper-alpha | none |
| Initial Value: | disc |
| Applies to: | Elements with display
value list-item |
| Inherited: | Yes |
The list-style-type property specifies the type of list-item marker, and is used if list-style-image is none or if image loading is turned off.
Examples:
LI.square { list-style-type: square }
UL.plain { list-style-type: none }
OL { list-style-type: upper-alpha } /* A B C D E etc. */
OL OL { list-style-type: decimal } /* 1 2 3 4 5 etc. */
OL OL OL { list-style-type: lower-roman } /* i ii iii iv v etc. */
List Style Image
| Syntax: | list-style-image: <value> |
|---|---|
| Possible Values: | <url> | none |
| Initial Value: | none |
| Applies to: | Elements with display
value list-item |
| Inherited: | Yes |
The list-style-image property specifies the image that will be used as list-item marker when image loading is turned on, replacing the marker specified in the list-style-type property.
Examples:
UL.check { list-style-image: url(/LI-markers/checkmark.gif) }
UL LI.x { list-style-image: url(x.png) }
List Style Position
| Syntax: | list-style-position: <value> |
|---|---|
| Possible Values: | inside | outside |
| Initial Value: | outside |
| Applies to: | Elements with display
value list-item |
| Inherited: | Yes |
The list-style-position property takes the value inside or outside, with outside being the default. This property determines where the marker is placed in regard to the list item. If the value inside is used, the lines will wrap under the marker instead of being indented. An example rendering is:
Outside rendering: * List item 1 second line of list item Inside rendering: * List item 1 second line of list item
List Style
| Syntax: | list-style: <value> |
|---|---|
| Possible Values: | <list-style-type> ||
<list-style-position> || <url> |
| Initial Value: | Not defined |
| Applies to: | Elements with display
value list-item |
| Inherited: | Yes |
The list-style property is a shorthand for the list-style-type, list-style-position, and list-style-image properties.
Examples:
LI.square { list-style: square inside }
UL.plain { list-style: none }
UL.check { list-style: url(/LI-markers/checkmark.gif) circle }
OL { list-style: upper-alpha }
OL OL { list-style: lower-roman inside }
- CSS Menus
- CSS Introduction
- CSS Reference
- 1 About the CSS2 Specification
- 2 Introduction to CSS2
- 3 Conformance: Requirements and Recommendations
- 4 CSS2 syntax and basic data types
- 5 Selectors
- 6 Assigning property values, Cascading, and Inheritance
- 7 Media types
- 8 Box model
- 9 Visual formatting model
- 9.1 Introduction to the visual formatting model
- 9.2 Controlling box generation
- 9.3 Positioning schemes
- 9.4 Normal flow
- 9.5 Floats
- 9.6 Absolute positioning
- 9.7 Relationships between 'display', 'position', and 'float'
- 9.8 Comparison of normal flow, floats, and absolute positioning
- 9.9 Layered presentation
- 9.10 Text direction: the 'direction' and 'unicode-bidi' properties
- 10 Visual formatting model details
- 10.1 Definition of "containing block"
- 10.2 Content width: the 'width' property
- 10.3 Computing widths and margins
- 10.4 Minimum and maximum widths: 'min-width' and 'max-width'
- 10.5 Content height: the 'height' property
- 10.6 Computing heights and margins
- 10.7 Minimum and maximum heights: 'min-height' and 'max-height'
- 10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
- 11 Visual effects
- 12 Generated content, automatic numbering, and lists
- 13 Paged media
- 14 Colors and Backgrounds
- 15 Fonts
- 16 Text
- 17 Tables
- 18 User interface
- 19 Aural style sheets
- 19.1 Introduction to aural style sheets
- 19.2 Volume properties: 'volume'
- 19.3 Speaking properties: 'speak'
- 19.4 Pause properties: 'pause-before', 'pause-after', and 'pause'
- 19.5 Cue properties: 'cue-before', 'cue-after', and 'cue'
- 19.6 Mixing properties: 'play-during'
- 19.7 Spatial properties: 'azimuth' and 'elevation'
- 19.8 Voice characteristic properties: 'speech-rate', 'voice-family', 'pitch', 'pitch-range', 'stress', and 'richness'
- 19.9 Speech properties: 'speak-punctuation' and 'speak-numeral'
- Appendix A. A sample style sheet for HTML 4.0
- Appendix B. Changes from CSS1
- Appendix C. Implementation and performance notes for fonts
- Appendix D. The grammar of CSS2
- Appendix E. References
- Appendix F. Property index
- Appendix G. Descriptor index
- Appendix H. Index
