[thelist] input type=file and CSS

McCreath_David McCreath_David at xmail.asd.k12.ak.us
Fri Feb 23 15:52:31 CST 2001


Has anyone had any luck reining in the wild <input type="file"> tag with
regards to CSS appearance?

Here's my situation (it's on our intranet, so I don't have an immediate
example to show you):

In our linked stylesheet, we have this:

input,select,textarea
	{	margin-top: 3px;
		font-size: 11px;
		background: #ffffff;
		margin-bottom: 3px;
		color: #000000;
		font-family: arial, helvetica, sans-serif;} 

And on one our pages we have this:

<form method="post" 
      enctype="multipart/form-data" 
      action="edithome.asp" 
      id="form1" name="form1">

[ other stuff removed for brevity ]

<input type="file" size="20" name="file1" style="width:80%"><br>
<input type="hidden" name="filename" value="homepageimage.jpg">
<input type="submit" value="Upload!" id="submit2" name="submit2">

[ other stuff removed for brevity ]

</form>

The results are mixed from browser to browser but basically along these
lines: the submit button "Upload!" is formatted properly, but the
"Browse..." button that shows up with the <input type="file"> is not (except
in IE5/Mac). Oddly enough, Netscape 6 on Mac shows the worst behavior, where
it doesn't even pick up the font. All the other browsers are picking up the
font and not the color.

I tried applying a separate class to just that input with a bgcolor of
#ffffff to no avail. (I double-checked by changing the color value of the
class and it affected the input *field*, but not the button.

This is hardly the end of the world, but it would be nice to have all the
buttons the same, ya know?

David




More information about the thelist mailing list