Textareas
Written by Jen

Textareas are great because they allow you to compact a huge amount of text into a small space and they display HTML, CSS and other codes. Any graphics site is advised to use textareas for their site.

Basic Textarea
The basic textarea has a pre-defined size and will look like this:

And this can be achieved by using the following code:

<textarea rows="1" cols="20"> This is what a textarea looks like. </textarea>

Do note that this page is using a stylesheet, which is why it looks a lot neater. If you'd like to have additional attributes on your textarea like scrollbar colors, please read up on the CSS guide.

Changing Attributes
Changing the size of a textarea is easy for some. There are hosts, such as Freewebs or Neopets petpages, who don't allow form tags, which is why some sites have to settle for the pre-defined sizes.

<form ACTION=URI><textarea rows="10" cols="20"> A bigger textarea than before. </textarea></form>

The above will give me something like this:

The cols stand for how wide it will be and the rows stand for how tall it will be. Don't ask why the ACTION=URI part has to be in capitals, I've never figured it out. You can try it with lower-cased letters, but it never seems to work... 0.o

You can also make the textarea have colored backgrounds like the following:

Or have a big thick border to emphasise it:

In fact, you can do just about anything to your textarea like have a special font, background image etc. This can be achieved by direct CSS embedding, ot using a stylesheet at the beginning of your page. And example code of the above combined would be:

<textarea style="border:2px solid green; background:yellow;" rows="1" cols="20"> A more colorful textarea than before. </textarea>

There are other ways to display your HTML or other codes, but textareas look nicer and have the best space-saving way to do it.