html - Textarea 框在点击初始页面加载时移动

标签 html css

我有一个文本框,它会在页面加载时初始点击时移动。这很奇怪,似乎有点问题,我什至不知道从哪里开始调试。

有没有人遇到过这种情况?

这是一张图片。白框立即返回到文本区域并且文本区域很好。它仅在初始点击时初始加载。

enter image description here

这是我的html

  

 .textarea {
      display: block;
      height: 100px;
      width: 100%;
      font-size: 24px;
    } 


.container {
  width: 100%;
  padding-top: 50px;
  text-align: center;
}

.title {
  color: #fdfdfd;
  font-size: 55px;
  margin-top: 50px;
  text-align: center;
  margin-bottom: 30px;
}

.label {
  color: seagreen;
  font-size: 19px;
}

.input {
  width: 100%;
  height: 45px;
  font-size: 24px;
  line-height: 45px;
}

.form-group {
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
}

.form {
  width: 500px;
  margin: 0 auto;
}

.submit {
  font-family: Chalk-c1;
  width: 300px;
  height: 43px;
  font-size: 24px;
  color: #fdfdfd;
  background-color: rebeccapurple;
  border: none;
  border-radius: 4%;
  cursor: pointer;
}

.textarea {
  display: block;
  height: 100px;
  width: 100%;
  font-size: 24px;
}

html {
  background-color: #111;
  font-family: Chalk-c1;
  color: #fdfdfd;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
}
<div class="container">
  <div class="title">Contact</div>
  <div class="form">
    <div class="form-group">
      <label for="name" class="label">Name</label><br>
      <input type="text" class="input" id="name" placeholder="John Doe">
    </div>
    <div class="form-group">
      <label for="email" class="label">Email</label><br>
      <input type="text" class="input" id="email" placeholder="john.doe@gmail.com">
    </div>
    <div class="form-group">
      <label for="message" class="label">Message</label>
      <textarea id="message" class="textarea" placeholder="How can we help you ... ?"></textarea>
    </div>
  </div>
  <button class="submit">Send Message</button>
</div>

enter image description here

最佳答案

我认为这是因为语法插件。一旦我遇到这种问题,但是当我关闭那个插件时,我就解决了。所以只要检查这是否有效..

关于html - Textarea 框在点击初始页面加载时移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47957205/

相关文章:

Javascript 不能在 div 下运行?

html - 使用 html 和 css 的省略号文本对齐设计

html - CSS:使按钮的颜色在中间变浅

html - 用作底部边框的图像 : possible to repeat image in the "after" pseudo element and control background size?

Jquery 数据表 dataTables_length

javascript - d3 条形图 : Trouble seeing my Graph. 可能存在 append() 问题

php - 如何使用 PHP Mysql 创建服务器机架表

html - 适合对象 : cover with percentages

jquery - 更改 fancybox 设计 - 添加另一个不晃动窗口的 div

javascript - 是否有可能在具有内联样式的样式标签上受到 XSS 攻击?