Help - Search - Members - Calendar
Full Version: Divs
Weborum Webmaster Forum > Web Page Design > HTML
deltacode
Hello *all*,
i was wondering how you would type into a div just like typing into a textarea, the reson i wont to use a div as you can use html inside the div, with textareas you cant do that.

Many thanks deltacode huh.gif
leo
you can type straight into the div like normal, eg:

CODE

<div style="font:12px verdana;"> text text</div>


that would style all text in that div, you can style different section also

CODE


<div>
style="font:12px verdana;"> text text</div>
</div>


or

CODE

<div>
<span style="font:12px verdana;">tex text</span></div>
Waleed
i think he wants it to look like a textbox?
leo
then all he needs is to add a border smile.gif
Waleed
no no no. i mean act like a textarea. like have it on a page, and get users to type stuff into it. bt i dont think thats possible, is it?
leo
ahh, ok that's easily done also

CODE

<textarea name="" rows="10" cols="40" style="border:1px solid black;overflow:auto;" ></textarea>
smile.gif

sorry missed it again, no can't use html inside textarea, can style it though smile.gif
Willy Duitt
You can write HTML tags into a textarea... The only problem you could possibly have is with a closing textarea tag ( </textarea> ) and only then if it is used in the default textarea value when the document is parsed... In which case you would need to convert the opening and closing carets to their respective ASCII equivelents ( &gt; and &lt; ) to compensate for this... BUT WRITING HTML into an already existing textarea would have no affect upon it simply because the textarea has already been parsed and has closed itself properly, not prematurely as a default value which includes a closing textarea tag would do...

However, here is an example of an editable division...
Style it any way you choose, I merely am demonstrating some style...

CODE

<div id="divEditable" contenteditable="true" style="width:400px;height:400px;background:#F2F2F2;border:3px dotted #333333"></div>


.....Willy
Willy Duitt
BTW: I would like to suggest that Leo modify the divisions which this board uses to display quote tags so that I could have the ability to more easily edit someones post to suit my particular needs whenever I am quoting them or taking screen shots to be used against them at a later date...

Thanks in advance;
roflmao.gif roflmao.gif

.....Willy
Waleed
so you can do that too! cool. thanks for the enlightnement Willy!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.