View Full Version : scrollbox/textbox customizing


arcade
10-25-2006, 04:21 PM
at the moment, i have this code on my site;

<textarea rows="3" cols="10" onClick="this.focus();this.select()">
blah blah content
</textarea>
and i would like to customize the background colour so its not just default white..how would i do this? (and it to work on both IE & firefox)

pb&j
10-25-2006, 04:28 PM
as like any other html element, you should be able to add a bit of style to it...

<textarea rows="3" cols="10" style="background-color:#ff0000;" onClick="this.focus();this.select()"> blah blah content </textarea>

arcade
10-25-2006, 04:41 PM
eee thanks :]]
do you know how to customize the border aswell?
and the colour, size and font of the text inside? lol

J to the izzosh
10-25-2006, 06:17 PM
While the textarea element is great and all, it is a form input field and is meant to receive content, not display it. You should try for the second method illustrated in this post:
http://www.lissaexplains.com/forum/showthread.php?p=404750#post404750

It's more semantically correct since it tells the browser that the content is "code" instead of displaying it in an input field. It's also easily customized using CSS. Feel free to take a look at this example page:
http://jfweb.fastmail.fm/disp_html/disp_html.htm

pb&j
10-25-2006, 10:05 PM
check here for other css coding...
http://www.lissaexplains.com/css.shtml

add the bits you want to the STYLE value seperating them with the semi-colon;