Useful Resources
syllabus | schedule | exercises | assignments | class notes | resources | students | ARTC courses
Form Attributes
Changing attributes of form elements

EX 1: The code...

In HEAD:

<style>

input.red {

background-color: #CC0000;
font-weight: bold;
font-size: 16px;
color: #FFFFFF;

}

</style>

In BODY:

<form>

<input name="my_button" type="button" class="red" onclick="my_web()" value="go to my website">

</form>

NOTE: Only the parts of the style effecting the font size and boldness will show up in Safari and Netscape (in regards to form buttons). The background-color and color will show up in IE. Test both browsers.

EX 2:

Type your name:


Type your address:


In HEAD:

<style>

//single line text box
input.blue {

background-color:#00FFFF;
font-size: 12px;
color:#000066;

}

//multi-line text area
textarea.black {

background-color:#000000;
font-size: 12px;
color:#99CC00;

}

</style>

In BODY:

<form>

<input name="namestring" type="text" class="blue" size="50">
<textarea name="address" cols="50" rows="4" class="black"></textarea>

</form>

[BACK to RESOURCES]