The wrap attribute
IE always does word wrapping in a textarea by default. But Netscape does not.
Your Netscape visitors will really appreciate it if you enable word wrapping
word them as well.
The wrap attribute is not part of the HTML standard, and when you
include it the W3C and WDG validators will report it as an error. As far as I'm
concerned, that's a minor trade-off for vastly improved functionally.
Depending on where you look, the options for wrap are
wrap="virtual|physical|off" or wrap="soft|hard|off"
"virtual" or "soft" mean that word wrapping should occur within the textarea box
but that no changes be made to the text when it is sent. "physical" or "hard"
means that word wrapping should occur within the textarea box and that a newline
character should be added at the end of each wrapped line when the form is sent.
It turns that that Netscape is perfectly happy if you just specify wrap
without a value!
<form>
<textarea rows="4" cols="10">MMMMMMMMMM No wrap attribute - La di da la di da la di da</textarea>
<textarea rows="4" cols="10" wrap>MMMMMMMMMM just wrap - Fe fi fo fum dumpty-dum</textarea>
<textarea rows="4" cols="10" wrap="virtual">MMMMMMMMMM wrap=virtual - Old McDonald had a farm</textarea>
<textarea rows="4" cols="10" wrap="physical">MMMMMMMMMM wrap=physical - Runnin' outta things to say</textarea>
<textarea rows="4" cols="10" wrap="off">MMMMMMMMMM wrap=off - La di da la di da la di da</textarea>
</form>
In Netscape 4 and in IE 4 and 5, these textareas are just wide enough to type 10 capital M's
on a line as requested by cols="10". IE uses a fixed-width font in the textarea boxes, and all
lines contain 10 characters. Netscape uses a variable-width font, and most lines can
contain much more than 10 characters.
IE 3 is just showing little tiny boxes. There's only room for 3 m's on a line.
|