کیسے بنائیں: تصویر پر فرم

سوچ سکیوئنسیس پر فرم شامل کیسے کریں: تصویر پر فرم

تصویر پر فرم

کہا جاتا ہے کیسے عمل انجمن: اپنے آپ پر چھاپ دیں

کس طرح میں تصویر پر فرم شامل کریں؟

پہلے قدم - HTML کا شامل کریں:

<div class="bg-img">
  <form action="/action_page.php" class="container">
    <h1>Login</h1>
    <label for="email"><b>Email</b></label>
    <input type="text" placeholder="Enter Email" name="email" required>
    <label for="psw"><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" required>
    <button type="submit" class="btn">Login</button>
  </form>
</div>

مرحله دوم - اضافه کردن CSS:

body, html {
  height: 100%;
}
* {
  box-sizing: border-box;
}
.bg-img {
  /* تصویر مورد استفاده */
  background-image: url("img_nature.jpg");
  /* ارتفاع تصویر را کنترل می‌کند */
  min-height: 380px;
  /* تصویر را در وسط قرار داده و به طور مناسب بزرگ‌تر می‌کند */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}
/* لایه‌ای برای اضافه کردن استایل به جعبه فرم تعریف شده است */
.container {
  position: absolute;
  right: 0;
  margin: 20px;
  max-width: 300px;
  padding: 16px;
  background-color: white;
}
/* فیلد ورودی تمام‌عرض تعریف شده است */
  input[type=text], input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  border: none;
  background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}
/* لایه‌ای برای تنظیمات دکمه ارسال تعریف شده است */
.btn {
  background-color: #04AA6D;
  color: white;
  padding: 16px 20px;
  border: none;
  cursor: pointer;
  width: 100%;
  شفافیت: 0.9;
}
.btn:hover {
  شفافیت: 1;
}

کہا جاتا ہے کیسے عمل انجمن: اپنے آپ پر چھاپ دیں