width property (pre)
Specifies or returns the preferred count of characters for each line in a pre element. If a line is longer than the specified character count, the browser will try to wrap it.
Use the width property together with the whiteSpace style property in Opera. The width property is equivalent to the cols property in Firefox.
You can find the related objects in the Supported by objects section below.
This property is read/write.
|HTML page for this property: width|
Integer that sets or retrieves the count of characters.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the width attribute:
Example HTML code 2:
This example illustrates a cross-browser solution instead of the width attribute:
Example HTML code 3:
This example illustrates the use of the width property:
User Contributed Comments