Welcome to WebmasterWorld Guest from 18.208.187.169

Forum Moderators: open

Message Too Old, No Replies

textarea wrap in XHTML?

What is the alternative in XHTML?

     
9:29 am on Apr 21, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Mar 29, 2003
posts:226
votes: 0


Hi, textarea used to have a really useful property of "Wrap=off". How do I achieve this in XHTML 1.1?

Thanks for any ideas, the site search did not reveal any result!

9:42 am on Apr 21, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 27, 2003
posts:664
votes: 0


In html the textarea tag has never had a wrap attribute. Netscape and IE both supported a proprietary wrap attribute but the values allowed were different (IE: off¦physical¦virtual, NN: off¦hard¦soft).

I think the best way to do it is with CSS. For example, you may be able to achieve the result you want with the white-space property. Possible Values are: normal¦pre¦nowrap

i.e.
white-space: nowrap;

Shawn

10:13 am on Apr 21, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Mar 29, 2003
posts:226
votes: 0


thanks shawn. didnt know about "white-space" at all!

however, "white-space: nowrap" works in Opera, but does not work in mozilla (wraps anyway) or IE (becomes only one line).

is there any solution to this, or should i leave it without white space?

10:50 am on Apr 21, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 27, 2003
posts:664
votes: 0


Hi Craig

Hmm... Even though IE doesn't do what you want, it seems it is within the spec (doesn't do a line break on any white space), even though this is not too sensible in the context of a form the user is filling in.

I'm afraid I don't know the answer. Perhaps a CSS guru might be able to help, so perhaps ask on the CSS forum.

Of course, if you don't find a solution, (putting on flame proof jacket now...) you could choose to just use the wrap attribute you used to use. It is not valid XHTML, but it never stopped you before and it was never valid HTML. (I'll probably get my WebmasterWorld membership revoked for that ;) )

Shawn