Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textarea wordwrap

Status
Not open for further replies.

Graeme06

Technical User
Jun 6, 2006
60
Hi, I have a textarea that I want to turn wordwrap OFF (it should only wrap when someone hits enter, otherwise the line could go on as long as someone wishes). In trying to get the code valid, Strict XHTML doesn't like wrap="off". Is there a CSS property that will work similarily?

Thanks,
Graeme
 
Code:
style="white-space: nowrap;"
works on Mozilla, not sure about IE though.
 
hmm thanks, but that seemed to do nothing. The full line is <textarea name="footer" rows="4" cols="60" style="white-space: nowrap;"> and it still wraps
 
Well, as usual, IE requires a bit more persuasion but in the end gets there. This works in Mozilla and IE6 for me:
Code:
<textarea name="footer" rows="4" cols="60" style="white-space: nowrap; overflow: auto;">
 
really, in Firefox and Mozilla the code does nothing for me, while in IE (even without that overflow part), it puts it on one line and won't allow it on another even if you hit enter.
 
Strangely, Mozilla works perfectly for me. IE6 I must confirm that does not go into the next line. I guess I didn't really test this to full extent.

What version of FF/Mozilla do you use? And what is your doctype?
 
I've tried it in both Mozilla 1.7 and Firefox 1.5. I'm using Doctype:XHTML 1.0 Strict//EN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top