|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS for File field in a form???
I have written a style sheet that has styles for the TEXT field and for the BUTTON. But when it comes to the FILE field is there a way that I can write a style that would add different styles to the textbox and the button? Here are the styles that I have written for the TEXT field and the BUTTON. I need a way to write it for the FILE field. Any suggestions??
Code:
.txtboxes {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
background-color: #FFFFFF;
border: 1px ridge #000000;
}
.buttons {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #CC0000;
background-color: #FFFFFF;
border: 1px ridge #CC0000;
}
|
|
#2
|
|||
|
|||
|
RE: CSS for File field in a form???
nazly,
I don't think you can change the colour of the browse button in file input element.:uhoh: But it is possible play with the text field which the filename displays. Code:
<html>
<head>
<title>Untitled Document</title>
<style>
input
{ margin-top: 3px;
font-size: 11px;
background: #ff0000;
margin-bottom: 3px;
color: #ffffff;
font-family: arial, helvetica, sans-serif;
}
</style>
</head>
<body>
<form>
<input type="file" size="20" name="file1" style="width:80%">
</form>
</body>
</html>
Look here : http://www.cs.tut.fi/~jkorpela/forms/file.html#present Same kind of thread going on here : http://forums.devshed.com/t26278/s.html |
|
#3
|
|||
|
|||
|
RE: CSS for File field in a form???
I just tried all of this in file input type. But no luck, everything styles only the textfield, not the browse button...
Code:
<input type="file" style="border:0; color:#FF0000; background-color:#efefef; font-family:Verdana; text-align:right; text-decoration:line-through; cursor:help"> |
|
#4
|
|||
|
|||
|
RE: CSS for File field in a form???
Thats not what I wanted.. I have gone through all that.. Is there a way to use the styles that I have written for TEXT and BUTTON to apply seperately for the textbox and the button of the FILE field.
|
|
#5
|
|||
|
|||
|
RE: CSS for File field in a form???
no you can't style it, and that's a good thing.
if you could style it, you could make it look like something else than a upload button, and you could trick some beginner computer user into uploading some important file... that would be a big security risk... |
|
#6
|
|||
|
|||
|
RE: CSS for File field in a form???
I didn't know that there is a big story behind this. The idea is correct but I don't beleive that because of that reason the restriction applies to adding styles to File field.. Correct me if I'm wrong..
I have several text boxes + 2 file field + Submit button in my form where the user can enter product details and upload the product images. The style applies to the text boxes and buttons pefectly. But coz of this File field the whole page design looks kinda messed up.. I have to look for a way to fix this. Coz the design does matter. Any suggestions are welcome.. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > CSS for File field in a form??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|