JSFiddle - React, Tailwind, and code Playground

by adonis11

HTML

<section>
      <h2>Вход на сайт</h2>
      <form>
        <div>
          <input type="text" name="" required="">
          <label>Логин</label>
        </div>
        <div>
          <input type="password" name="" required="">
          <label>Пароль</label>
        </div>
        <input type="Submit" name="" value="Вход">
      </form>
    </section>

CSS

@import url('https://fonts.googleapis.com/css?family=Caveat:700');

* {
  box-sizing: border-box;
}
body {
  background: url(https://cdn.pixabay.com/photo/2017/06/12/17/54/anemone-2396299_1280.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Caveat', sans-serif;
  margin: 0;
  padding: 0;
}
section {
  background: rgba( 0,0,0,.6);
  border-radius: 5px;
  left: 50%;
  padding: 40px;
  position: absolute;
  transform: translate(-50%, -50%);
  top: 50%;
  width: 400px;
}
section h2 {
  color: #fff;
  font-family: 'Caveat', sans-serif;
  font-size: 30px;
  margin: 0 0 30px;
  padding: 0;
  text-align: center;
}
section div {
  position: relative;
}
section div input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  font-family: 'Caveat', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  margin-bottom: 30px;
  padding: 10px 0;
  outline: none;
  width: 100%;
}
section div label {
  color: #fff;
  font-size: 22px;
  left: 0;
  letter-spacing: 1px;
  padding: 10px 0;
  position: absolute;
  pointer-events: none;
  top: 0;
  transition: .5s;
}
section div input:focus ~ label,
section div input:valid ~ label {
  color: #2d89ea;
  font-size: 22px;
  left: 0;
  top: -22px;
}
section input[type="submit"] {
  background: #2d89ea;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-family: 'Caveat', sans-serif;
  font-size: 24px;
  padding: 6px 28px;
  outline: none;
}