javascript - 如何防止textarea重叠列表
问题描述
我创建了一个可以运行的信使应用程序,但是文本框与消息重叠存在一个问题。我的 HTML:
<div>
<ul id="messages"></ul>
</div>
<form onsubmit="return sendMessage();">
<br>
<br>
<br>
<div>
<textarea id="message" placeholder="Enter message..." rows="3" cols="195"></textarea>
<input type="submit" id="submitibtn">
</div>
</form>
CSS:
#message {
resize: none;
position: fixed;
bottom: 0;
height: 70px;
}
#message:hover {
border: 2px solid black;
}
#submitibtn {
background-color: cornflowerblue;
width: 1580px;
height: 30px;
position: fixed;
bottom: 0;
}
#submitibtn:hover {
border: 2px solid blue;
}
如果您想亲自查看,请访问 网站: https ://messengerwebapp.firebaseapp.com/ (以匿名身份登录并发送消息,然后查看与消息重叠的文本区域)
解决方案
更改您的 CSS。这就是导致问题的原因
#message {
resize: none;
position: fixed;
bottom: 0;
height: 70px;
}
尝试这个
#message {
resize: none;
height: 70px; /* THE HEIGHT SHOULD INHERIT YOUR ROWS ON THE TEXTAREA */
}
推荐阅读
- c# - EF6 从数据库返回错误数据
- php - 正确读取和编辑包含编码 HTML 和 HTML 编码特殊字符的 csv 文件
- python - 资源需求流程是否分为多个流程?
- delphi - 如何在 Firemonkey 中最大化对齐/调整 5 个矩形的大小?
- android - 编译问题(在 tissot_sprout 上)
- python - 使用 Python request.get 参数,但它给了我错误的 url
- javascript - 动态添加时第一个组件上的单击组件触发事件
- kubernetes - Kubernetes 和 Kubernetes Engine 有什么区别?
- python-3.x - 在模块内调用函数
- mysql - 为什么 MAX() 不会选择相应的最大值行详细信息?