这是一个例子
<style type = "text/css">
.thequoteofpee {
position: absolute;
left: 464px;
top: 362px;
font-size: 20px;
width: 420px;
height: 40px;
border-color: #00297A;
border: 1px;
border-style: solid;
background-color: white;
text-indent: 10px;
}
</style>
<body>
<input name = "thequoteofpee" class = "thequoteofpee" type = "quote" placeholder = "Bio"/>
</body>
有谁知道如何让这个人只能输入 150 个字符。你是怎么做到的,所以有一个 text-indent
从右边进来,这样看起来更好。感谢任何试图回答这个问题的人!
附言 我没有什么可以给这个类(class)命名的,所以我给它起了一个奇怪的名字。
最佳答案
对于文本缩进,您可以改用填充,因此您可以控制四个值 top、right、bottom 和 left,而不是 text-indent 提供的一个值,就像这样:
padding: 0 10px 0 10px;
限制字符的最大长度使用 maxlength="20"
,Update 使用它作为这样的属性
<input name = "thequoteofpee" class = "thequoteofpee" type = "quote" placeholder = "Bio" maxlength="20"/>
关于javascript - 如何使用溢出-x : hidden on <input type = "number">,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33357205/