答案 0 :(得分:1)
尝试将输入包装在容器中并限制其宽度,然后在容器上使用溢出属性代替输入:
div {
width: 100px;/*for example only*/
overflow: auto;
white-space: nowrap;/*for example only*/
padding: 10px;/*for example only*/
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
<div>
<input type="text" value="687sjkfkjahfkgjahskjdghaskhkjhasdkjghasjkhgkjsadhgkjsdkjfhskdhfkjsa">
</div>
<div>
<input type="text" value="687sjkfkjahfkgjahskjdghaskhkjhasdkjghasjkhgkjsadhgkjsdkjfhskdhfkjsa">
</div>
<div>
<input type="text" value="687sjkfkjahfkgjahskjdghaskhkjhasdkjghasjkhgkjsadhgkjsdkjfhskdhfkjsa">
</div>
<div>
<input type="text" value="687sjkfkjahfkgjahskjdghaskhkjhasdkjghasjkhgkjsadhgkjsdkjfhskdhfkjsa">
</div>
<div>
<input type="text" value="687sjkfkjahfkgjahskjdghaskhkjhasdkjghasjkhgkjsadhgkjsdkjfhskdhfkjsa">
</div>