-1

This is not a question about vertically centring in div exactly, but displying the label on the hidden File Input to be vertically aligned?

https://jsfiddle.net/pbv07uxm/

enter image description here

table {
  font-family: sans-serif;
}

.submitButton {
  height: 44px;
  width: 104px;
  display: block;
  background-color: #002044;
  color: white;
}

.hide {
  display: none;
}

.fileLabel {}

#photoButton {
  text-align: center;
}
<table>
  <tr>
    <td>
      <input class="submitButton" type="submit" value="Back">
    </td>
    <td>
      <input class="submitButton" type="submit" value="End">
    </td>
    <td>
      <div id="photoButton">
        <input type="file" name="photo" id="photo" class="hide" accept="image/*" capture="camera" />
        <label for="photo" class="submitButton fileLabel">Take photo</label>
      </div>
    </td>
  </tr>
</table>
RGriffiths
  • 5,722
  • 18
  • 72
  • 120

1 Answers1

3

You can use flex. add these styles to

.fileLabel {
display:flex;
align-items:center;
justify-content:center;
}

https://jsfiddle.net/Lmzyt17v/

Reza Sam
  • 1,264
  • 2
  • 14
  • 29