html - 如何删除末尾的可用空间?
问题描述
为什么display: inline-block
不能正常工作<input type="file">
?
我希望元素的宽度与它所构成的内容一样宽(按钮+文本)。但是文本的末尾总是有一些空闲空间。
为什么?这可以解决吗?
input[type="file"] {
display: inline-block;
min-width: auto;
width: auto;
background-color: lightgray;
}
<input type="file">
解决方案
我不知道它是否适合您,但是可以width
通过 CSS 设置:
input[type='file'] {
width: 180px;
background-color: lightgreen;
}
<input type="file">
推荐阅读
- performance - 在 Biguqery 中,一个插槽会消耗多个插槽吗?
- mysql - 如何根据另一列的相同值计算一列的行数?
- angular - Angular 9 mat-card-actions' 不是已知元素
- android - Android Screen Share - 表面参数
- apache-flink - 为什么以并行度 = 1 执行 Flink 作业是不好的?
- r - R中的相关循环
- flutter - 颤振视频播放器
- xamarin - Xamarin 表单应用程序即使在卸载和安装应用程序后仍保留 SQLite 数据库,即使清单配置为 AllowbackUp 为 false
- python - 根据条件调整 numpy 数组
- c++ - 如何遍历霍夫曼树(通过代码)并打印出每个字母的编码?