0

Hi im doing the css integration of a design im not a pro in javvascript just understand the basics. anyway..

I found a input file, that i cant style i found some tutorials, but all of them show how to do it on a normal button , im afraid of causing an issue for maybe some browsers .. or some other issue..

the button im trying to style is

<input name="image1" type="file" class="imatienda" onChange="parent.window.location.hash = 'block';document.ajax_upload.submit();">

I found for example this, but as i said, this is working on a normal input file with no javascript already on it. :D

thanks

1
  • 1
    The javascript has no effect on styling the button. Commented Nov 12, 2013 at 1:45

2 Answers 2

1

Javascript attributes are largely irrelevant to CSS styling.

<input name="image1" type="text" onChange="parent.window.location.hash = 'block';document.ajax_upload.submit();">

input{
    padding:15px 25px;
    background:red;
    border:none;
}

input type=file is, however, a bit of an issue all around the board because they're just hard to style - not too much that can be done about it. Take a look here on SO for some more info, and here for another possible work around.

Sign up to request clarification or add additional context in comments.

Comments

0

I solved using this great method :D http://jsfiddle.net/gabrieleromanato/mxq9R/

HTML

<form action="" method="post" enctype="multipart/form-data">
    <div class="upload">
        <input type="file" name="upload"/>
    </div>
</form>

CSS

div.upload {
    width: 157px;
    height: 57px;
    background: url(https://lh6.googleusercontent.com/-dqTIJRTqEAQ/UJaofTQm3hI/AAAAAAAABHo/w7ruR1SOIsA/s157/upload.png);
    overflow: hidden;
}

div.upload input {
    display: block !important;
    width: 157px !important;
    height: 57px !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.