1

I'm trying to align the text to have the same padding as the choose file button.

input[type='file'] {
    background: #000;
    border-radius: 5px;
    color: #fff;
    font-family: "Marmellata", sans-serif;
    padding: 6px 10px 14px 17px;
    font-size: 20px;
    margin-bottom: 20px;
    width: 240px;
    vertical-align: top;
    margin-top: 0px;
}
<input name="t1" class="imgupload" type="file" accept="image/*" capture="camera">

EDIT:

I have solve the problem by using this method:

.select-image-btn input[type=file] {
        font-size: 100px;
        position: absolute;
        left: 0;
        top: 0;
        opacity: 0;
        }

.select-image-btn {
        position: relative;
        overflow: hidden;
        display: inline-block;
        }

Just add class name on

input[type=file]

The div should be like this

<div class="select-image-btn">
      <button class="btn default" >Upload a file</button>
      <input type="file" name="t1" accept="image/*" capture="camera">
</div>
Snowbases
  • 2,316
  • 2
  • 20
  • 26
Blynn
  • 1,411
  • 7
  • 27
  • 48

1 Answers1

-1

why don't you use the the following ?

input.imgupload {
background: #000;
border-radius: 5px;
color: #fff;
font-family: "Marmellata", sans-serif;
padding: 6px 10px 14px 17px;
font-size: 20px;
margin-bottom: 20px;
width: 240px
vertical-align: top;
margin-top: 0px;
}

Anyways the class has a stronger weight than an attribute selector.

hayonj
  • 1,429
  • 3
  • 21
  • 28