javascript - change the css of file_field? -


I want to change css for file_field. Instead of showing the original browse button I want to use the Simple Upload button to upload the file.

How can I change the file_field's CSS and set the second image on it? So this file will look like a button instead of upload control.

View

   & Lt; Div class = "fileinputs" & gt; & Lt; Input type = "file" name = "upload" id = "upload" class = "file" onchange = "this.form.submit ();" / & Gt; & Lt; Div class = "fakefile" & gt; & Lt; Input class = "upload_btn" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt;% end% & gt;   

CSS

  div.fileinputs {status: relative; } Div.fakefile {Position: Absolute; Top: 0 pixels; Left: 0 pixels; Z-index: 1; } Input.file {status: relative; Text align: right; -Moofness: 0; Filter: Alpha (Opacity: 0); Opacity: 0; Z-index: 2; } Input.upload_btn {Background: Transparent URL (/images/upload_btn.gif) No-Dual Scroll 0 px 0px; Width: 79px; Height: 26px; Cursor: indicator; Border: 0px; } Input.upload_btn: Hover {Background: Transparent URL (/images/upload_btn.gif) No-Dual Scroll 0 Px-40px; }    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -