Cool Login Page in HTML + CSS

Danish Qazi

Member
Staff member
554102914_801757269263404_8192768572536699542_n.jpg
Code:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Modern Login Page</title>
  <style>
    body {
      margin: 0;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
      background-size: 300% 300%;
      animation: bgAnimation 8s infinite alternate;
      font-family: Arial, sans-serif;
    }
    @keyframes bgAnimation {
      0% { background-position: left; }
      100% { background-position: right; }
    }
    .login-box {
      background: rgba(30, 41, 59, 0.9);
      padding: 40px;
      border-radius: 20px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.6);
      width: 320px;
      text-align: center;
      animation: popUp 1s ease forwards;
      transform: scale(0.9);
    }
    @keyframes popUp {
      from { transform: scale(0); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    .login-box h2 {
      margin-bottom: 20px;
      color: #f8fafc;
      font-size: 1.8rem;
    }
    .input-box {
      position: relative;
      margin-bottom: 20px;
    }
    .input-box input {
      width: 100%;
      padding: 12px;
      background: #0f172a;
      border: none;
      outline: none;
      border-radius: 10px;
      color: #f1f5f9;
      font-size: 1rem;
      box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
    }
    .input-box input::placeholder {
      color: #94a3b8;
    }
    .btn {
      width: 100%;
      padding: 12px;
      border: none;
      border-radius: 10px;
      background: #10b981;
      color: #fff;
      font-size: 1rem;
      cursor: pointer;
      transition: 0.3s;
      box-shadow: 0 4px 0 #047857, 0 6px 15px rgba(0,0,0,0.4);
    }
    .btn:hover {
      background: #059669;
    }
    .btn:active {
      transform: translateY(3px);
      box-shadow: 0 2px 0 #047857, 0 3px 10px rgba(0,0,0,0.3);
    }
    .extra-links {
      margin-top: 15px;
    }
    .extra-links a {
      color: #38bdf8;
      text-decoration: none;
      font-size: 0.9rem;
    }
    .extra-links a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <div class="login-box">
    <h2>Login</h2>
    <div class="input-box">
      <input type="text" placeholder="Username">
    </div>
    <div class="input-box">
      <input type="password" placeholder="Password">
    </div>
    <button class="btn">Login</button>
    <div class="extra-links">
      <a href="#">Forgot Password?</a><br>
      <a href="#">Create Account</a>
    </div>
  </div>
</body>
</html>
 
1000134859.jpg

Code:
<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Modern Login Page</title>

  <style>

    * {

      margin: 0;

      padding: 0;

      box-sizing: border-box;

      font-family: 'Poppins', sans-serif;

    }

    body {

      height: 100vh;

      display: flex;

      justify-content: center;

      align-items: center;

      background: url('https://images.unsplash.com/photo-1522199710521-72d69614c702') no-repeat center center/cover;

    }

    .login-box {

      width: 350px;

      background: rgba(0, 0, 0, 0.7);

      padding: 40px;

      border-radius: 15px;

      box-shadow: 0 0 25px rgba(0,0,0,0.7);

      color: white;

    }

    .login-box h2 {

      text-align: center;

      margin-bottom: 25px;

      font-size: 28px;

      letter-spacing: 2px;

      color: #fff;

    }

    .login-box .input-box {

      position: relative;

      margin-bottom: 20px;

    }

    .login-box .input-box input {

      width: 100%;

      padding: 12px 15px;

      border: none;

      outline: none;

      border-radius: 8px;

      font-size: 16px;

      background: rgba(255, 255, 255, 0.1);

      color: #fff;

    }

    .login-box .input-box input::placeholder {

      color: #ccc;

    }

    .login-box button {

      width: 100%;

      padding: 12px;

      border: none;

      border-radius: 8px;

      font-size: 16px;

      cursor: pointer;

      background: linear-gradient(135deg, #00c6ff, #0072ff);

      color: white;

      transition: 0.3s;

    }

    .login-box button:hover {

      background: linear-gradient(135deg, #0072ff, #00c6ff);

    }

    .login-box p {

      margin-top: 15px;

      text-align: center;

      font-size: 14px;

    }

    .login-box p a {

      color: #00c6ff;

      text-decoration: none;

    }

    .login-box p a:hover {

      text-decoration: underline;

    }

  </style>

</head>

<body>

  <div class="login-box">

    <h2>Login</h2>

    <div class="input-box">

      <input type="text" placeholder="Username" required>

    </div>

    <div class="input-box">

      <input type="password" placeholder="Password" required>

    </div>

    <button type="submit">Login</button>

    <p>Don't have an account? <a href="#">Sign Up</a></p>

  </div>

</body>

</html>
 
Back
Top