CSS: #form-6ren">
gpt4 book ai didi

HTML 表单光标位置在中间

转载 作者:行者123 更新时间:2023-11-28 10:58:07 26 4
gpt4 key购买 nike

出于某种原因,当我的表单显示时,文本内容垂直对齐了一半。我不确定为什么?我在 Ruby 上使用 Sinatra。

HTML:

<form action="/create" method="post">
<h1>Arrays:</h2><br>
<input type="text" name="file" value="<%= @contents1 %>" id="form">
</form>

CSS:

#form {
width: 100%;
height: 120px;
border: 3px solid #cccccc;
padding: 5px;
font-family: calibri, sans-serif;
font-size: 12px;
}

JSFiddle

最佳答案

是因为<input type='text'>仅设计用于处理单行文本。你是不是想用 <textarea>相反?

关于HTML 表单光标位置在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22555578/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com