首页 > 解决方案 > 无法让占位符出现在输入框中

问题描述

.main {
  background-color: #151515;
}

.signup_container {
  align-items: center;
  justify-self: center;
  margin: 0 auto;
  height: 100vh;
  background-color: #151515;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  padding: 0 50px;
}

.signup_content {
  padding-top: 100px;
  font-size: 2rem;
  background-color: #ff8177;
  background-image: linear-gradient(to top, #ff0844 0%, #ffb199 100%);
  background-size: 50%;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
  text-align: center;
}

.signup_input-position {
  position: relative;
  align-items: center;
  justify-self: center;
  margin: 0 auto;
  width: 200px;
  height: 25px;
  display: block;
  margin-top: 25px;
}
<div class="main">
  <div class="signup_container">
    <div class="signup_content">
      <h1>Sign Up</h1>
      <input type="text" name="uname" placeholder="Username" class="signup_input-position" />
    </div>
  </div>
</div>

我在那里有一堂课和一个占位符,但是我不明白为什么占位符没有出现在输入框中。

注册页面的图像。

html中定义的一些css

标签: html

解决方案


不用担心,我只会使用简单的颜色而不是渐变。不能被要求浪费我的时间。


推荐阅读