html - 使 HTML 输入数字上的向下箭头更大更清晰

标签 html css html-input

而不是 Is it possible to always show up/down arrows for input "number"? , 我希望能够使向上/向下箭头更大更干净。

我现在拥有的:

我需要像这样把它们变大:

最佳答案

您可以将输入包装在元素中并设置样式

div {
  display: inline-block;
  position: Relative;
  border: 2px solid grey;
  border-radius: 10px;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
div:before,
div:after {
  background: white;
  right: 0px;
  width: 30px;
  height: 20%;
  position: absolute;
  pointer-events: none;
}
div:before {
  content: '';
  bottom: 50%;
  background: url(http://cdn.flaticon.com/png/256/22205.png) no-repeat white;
  background-size: 20px;
  background-position: center;
}
div:after {
  content: '';
  top: 50%;
  background: url(http://cdn.flaticon.com/png/256/22205.png) no-repeat white;
  background-size: 20px;
  transform: rotate(180deg);
  background-position: center;
}
input {
  height: 80PX;
  font-size: 50px;
  outline: 0;
  border: 0;
}
<div>
  <input type="number" value="10" />
</div>

关于html - 使 HTML 输入数字上的向下箭头更大更清晰,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29598247/

相关文章:

php - 如何使用 mongodb 和 php 上传用户特定的图像

javascript - 如何在html中的按钮标签内给出一个href

html - 在 IE9 中显示全零的有序列表

jquery - 当视口(viewport)宽度小于 HTML 页面宽度时,如何让固定元素水平滚动?

javascript - 从数组 Javascript 生成随机元素组

javascript - IE 在重新加载嵌入了 swfobject 的页面时抛出 'Unspecified error'

html - 箭头分解到 IE11 中的下一行

css - 避免 CSS 类名冲突

javascript - 如何确保 HTML 输入仍然是必需的?

html - 输入类型 DateTime - 值格式?