View Full Version : css and forms

12-29-2006, 05:56 PM
How do I add a background-color in forms?
How do I add a background-picture in forms, too?

12-29-2006, 06:11 PM
You put a div in between the form tags and apply colors/images to the div.

12-29-2006, 06:25 PM
could we just make it

<style type="text/css">
input.1{background: myimage.jpg}
.2{background-color: #cfcccc}

12-29-2006, 06:51 PM
The syntax you are using is a little incorrect. First off ids or classes can't start with a number or special character. So using .1 and .2 is already incorrect. Second your background declaration contains no url(). Correct syntax would be

<style type="text/css">
input.one{background: url(myimage.jpg)}
.two{background-color: #cfcccc}

<form class="two">
<input class="one" type="text">