473,503 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Word wrap - textarea inside div

Hello, I am have a div and inside of that div I have a textarea. There
is nothing else in the div. The text in the textarea will come from a
database so it needs to be able to wrap and grow as necessary. I've
tried a whole bunch of permutations and I'm not having any luck. Any
help would be greatly appreciated. Here's the code:

HTML:

<div class='desc'><textarea class='desc_text'>blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
</textarea></div>

CSS:

..desc
{
height: auto;
min-height: 14px;
background: #FFFFFF;
border: 0px solid #000000;
border-left-width: 1px;
font: 11px tahoma;
padding: 2px 2px 2px 2px;
margin: 0px;
float: left;
overflow: auto;
width: 225px;
text-align: left;
}

..desc_text
{
width: 220px;
text-align: left;
margin: 0px;
padding: 0px;
height: 13px;
font: 11px tahoma;
border: 0px;
}

Thank You.

Jun 19 '06 #1
2 19254
ma**********@gmail.com <ma**********@gmail.com> scripsit:
The text in the textarea will come
from a database so it needs to be able to wrap and grow as necessary.
Is the text a useful _default value_ for an input field? If not, it should
not appear as textarea content. You might need to reconsider the idea, and
the technical side could become completely different, since textarea
elements are rather idiosyncratic, in implementations.

By HTML definition, textarea content _should not_ auto-wrap but it should
appear exactly as written. Are you sure you should _rely_ on CSS for
defeating this by-design feature? (Browsers are known to auto-wrap by
default, but you can rather reliably defeat this misfeature by using the
nonstandard attribute wrap="off".)
I've tried a whole bunch of permutations and I'm not having any luck.
Any help would be greatly appreciated. Here's the code:
You are not explaining what you wish to accomplish - and why. If the
textarea content is a meaningful default value, why shouldn't it be rendered
as written, especially considering the fact that line breaks may matter?
width: 220px; - - font: 11px tahoma;
border: 0px;


Wrong approach. User input, if anything, should adapt to the user-selected
font size. Hence, setting a width in pixels is wrong, too.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 19 '06 #2

Jukka K. Korpela wrote:
ma**********@gmail.com <ma**********@gmail.com> scripsit:
The text in the textarea will come
from a database so it needs to be able to wrap and grow as necessary.


Is the text a useful _default value_ for an input field? If not, it should
not appear as textarea content. You might need to reconsider the idea, and
the technical side could become completely different, since textarea
elements are rather idiosyncratic, in implementations.

By HTML definition, textarea content _should not_ auto-wrap but it should
appear exactly as written. Are you sure you should _rely_ on CSS for
defeating this by-design feature? (Browsers are known to auto-wrap by
default, but you can rather reliably defeat this misfeature by using the
nonstandard attribute wrap="off".)
I've tried a whole bunch of permutations and I'm not having any luck.
Any help would be greatly appreciated. Here's the code:


You are not explaining what you wish to accomplish - and why. If the
textarea content is a meaningful default value, why shouldn't it be rendered
as written, especially considering the fact that line breaks may matter?
width: 220px;

- -
font: 11px tahoma;
border: 0px;


Wrong approach. User input, if anything, should adapt to the user-selected
font size. Hence, setting a width in pixels is wrong, too.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jukka - thank you very much for your reply. I obviously wasn't
thinking about my problem in the right way and you have set me
straight! I'm scraping the textarea altogether.

Jun 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
21092
by: Toronto Web Designer | last post by:
<textarea name="application" cols="50" rows="12" wrap="virtual" class="textarea"></textarea> Apparently "wrap" is deprecated or not allowed for html 4.01, any suggestions on what I should use...
5
28066
by: Toronto Web Designer | last post by:
<textarea name="application" cols="50" rows="12" wrap="virtual" class="textarea"></textarea> Is there a way to include the wrap in CSS or is that a structure thing?
3
6726
by: Fluffy Convict | last post by:
I am trying to write a script that changes a textarea wrap realtime, basically like you can switch to and from "wordwrap" in Microsofts Notepad. Because of a bug...
8
52981
by: Mark D. Smith | last post by:
Hi I have googled but not found a solution to wordwrap in a textarea using firefox/netscape. is there a style sheet solution or am i stuck with not being able to force wrapping in a textarea...
9
9630
by: Joel Byrd | last post by:
I've got a div whose width is specified as a percentage so that if you shrink the browser window, the div shrinks, and the text inside the div wraps around to accommadate this. The problem is:...
10
72647
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
8
6926
by: gazza67 | last post by:
Hi, I want to do something that I thought would be simple but i cant seem to work it out, perhaps someone out there could help me. I want to browse for a file (it will be a word document),...
6
4606
by: Eric Layman | last post by:
Hi, I have fields from textareas. With a click of a button, php is able to grab these fields and by using header(), convert the output to Ms Word doc. But the outcome of the word doc...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.