# 输入框完美居中

<style>
  .main-input-align {
    width: 100%; height: 229px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .main-input-align ::-webkit-input-placeholder {
    line-height: 1.375em;
  }
  .main-input-align input {
    outline: none;
    color: #666;
    font-size: .9em;
    padding: .5em;
    border-radius: .2em;
    border: 1px solid #e3e3e3;
    -webkit-appearance: none;
  }
  .main-input-align input:hover {
    border: 1px solid #b4a078;
  }
  .main-input-align input:focus {
    border: 1px solid #b4a078;
    box-shadow: 0 0 0 2px rgba(180, 160, 120, 0.2);
  }
</style>
<template>
  <main class="main-input-align">
    <input type="text" placeholder="请填写手机号或姓名">
  </main>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
显示代码 复制代码
上次更新: 2023-10-28