css - 放大和缩小后输入下降

标签 css html input

这里我制作了两个简单的输入字段,但是当我在页面上放大和缩小(Ctrl + 鼠标滚轮)时,输入字段不知何故改变了位置,输入上下移动,为什么会这样?无论我放大还是缩小,如何让它们在同一个地方?

body {
  width: 870px;
}

#col3 {
  width: 400px;
  float: left;
  /*background-color:#383838;*/
  margin: 20px 10px 10px 30px;
}

form {
  width: 380px;
  margin: auto;
  padding: 5px;
  border: solid 1px white;
}

fieldset {
  margin: auto;
  border: solid 1px #E37222;
  padding-left: 19px;
  padding-top: 15px;
  background-color: #EEEEDD;
}

label {
  display: block;
  width: 70px;
  float: left;
  margin-left: 10px;
}

span {
  margin-left: -16px;
}

legend {
  background-color: #E37222;
  color: white;
}

input.tt {
  outline: 1px solid #909090;
}

.tt {
  margin-top: 8px;
}
<div id="col3">
  <form>
    <fieldset>
      <legend>eeeee</legend>

      <label for="name">
        <span>rrr:</span>
      </label>
      <input class="tt" type="text" size="34" />
      <br />

      <label class="tt" for="email">
        <span>ttt:</span>
      </label>
      <input class="tt" type="text" size="34" />

    </fieldset>
  </form>
</div>

......................................

最佳答案

删除 float:left对于 <label>

label{
    display:block;
    width:70px;
    margin-left:10px;

}

关于css - 放大和缩小后输入下降,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50568278/

相关文章:

javascript - 将复选框选择合并到appendChild中

c++ - 为什么按功能键或箭头键时 getch 会返回三个值?

HTML + CSS 渲染颜色

javascript - 当在 CSS 中专门设置颜色时,Mootools 补间颜色过渡被元素子元素拒绝

HTML CSS DIV 布局,顶部、左侧和右侧 DIV 固定在滚动中心 DIV 中

html - css:内联 css 以阻止内容调整父级大小

javascript - 使用 css 问题显示和隐藏一个 div 添加按钮单击时间

android - 使用 AlertDialog.Builder 从对话框中保存值

c中二维数组中整数的连续间隔输入

javascript - 为 "single-page"webapp 禁用惯性滚动