2

I'm creating a form via Laravel, and I'm running into a little issue with the Form::file() input field.

The out-of-the-box looks like the typical, basic button/file info:

choose file input

But even if I try to assign it to a class with styling for all input fields, nothing seems to be affecting it. For example...

<p class="text-center">
    {{ Form::file('photo', array('class'=>'form-control')) }}
</p>

...will only style the outer container of the input (not the button or text itself, and I can't seem to center it). I'm primarily using Bootstrap for my form's styles.

Am I doing something wrong that is making the file input default to its raw styling? Or is the file input type itself sort of separate from all of the other input types, needing to be customized from scratch?

cchapman
  • 3,269
  • 10
  • 50
  • 68
  • I don't believe you can style these as the browser itself controls how it looks and behaves. – user1669496 Feb 25 '15 at 21:50
  • possible duplicate of [How to style "input file" with CSS3 / Javascript?](http://stackoverflow.com/questions/3226167/how-to-style-input-file-with-css3-javascript) – user1669496 Feb 25 '15 at 22:21
  • I apologize if it does seem a duplicate. I guess to to clarify, my question isn't whether it's possible to style this type of input, but weather it's possible to use Bootstrap (or others) the same way that they automate the styles of all of the other types of inputs. – cchapman Feb 25 '15 at 22:29
  • Fighting with this right now. It can be done by not using the Laravel syntax for the file input and then stylizing it. But I, probably like you, am stuck with the Laravel. – Miles Sep 19 '17 at 14:10

0 Answers0