Helping ordinary people create extraordinary websites!
   

How to use image as textarea background using CSS?

Monday, 31st August 2009
by cgiFX


How can I use an image for the background of my textarea form field? I would like for it to only repeat horizontally and not vertically. Thank you.





Vader
Hi cgiFX,
To achieve this effect you can use the code below and modify it to suit your needs.

Here is the CSS you will need:

<style type="text/css">
<!--
textarea {
background-image: url(textarea_bg.jpg);
height: 200px;
width: 250px;
}
-->
</style>

Here is your html form with your textarea:

<form name="form1" method="post" action="page.php">
<textarea name="textarea">Sample text in textarea</textarea>
</form>

Vader
Monday, 9th November 2009
Votes:
28
21

More CSS Help:
» How can an image be implemented inside a list?
» How to create 3 column layout using CSS?
» When to use CSS Div vs CSS Span?
» How to style content container
» CSS Background Repeat Horizontally
» Alternate style sheet for https
» What are CSS sprites and how can I use them?
» How can I create a three column website layout in CSS?