隐藏文件输入上的标签要垂直对齐

格里菲思

这不是一个关于 div 垂直居中的问题,而是显示隐藏文件输入上的标签垂直对齐?

https://jsfiddle.net/pbv07uxm/

在此处输入图片说明

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>

雷萨·萨姆

您可以使用flex. 将这些样式添加到

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

https://jsfiddle.net/Lmzyt17v/

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章