Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> CSS

HTML और CSS से साइनअप फॉर्म कैसे बनाएं?


साइनअप फॉर्म में ईमेल, पासवर्ड, पासवर्ड दोहराएं, रिमेंबर मी चेकबॉक्स, शर्तें स्वीकृति, और कैंसल/साइनअप बटन शामिल हैं। गहरे हरे और लाल बटन स्पष्ट क्रिया अंतर प्रदान करते हैं।

उदाहरण

<!DOCTYPE html>
<html>
<head>
  <style>
    body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
    * { box-sizing: border-box; }
    input[type=text], input[type=password] {
      width: 100%; font-size: 28px; padding: 15px;
      margin: 5px 0 22px 0; display: inline-block;
      border: none; background: #f1f1f1;
    }
    label { font-size: 15px; }
    input[type=text]:focus, input[type=password]:focus {
      background-color: #ddd; outline: none;
    }
    hr { border: 1px solid #f1f1f1; margin-bottom: 25px; }
    button {
      font-size: 18px; font-weight: bold;
      background-color: rgb(10, 119, 13); color: white;
      padding: 14px 20px; margin: 8px 0; border: none;
      cursor: pointer; width: 100%; opacity: 0.9;
    }
    button:hover { opacity: 1; }
    .cancel { padding: 14px 20px; background-color: #ff3d2f; }
    .formContainer { padding: 16px; }
    .formContainer p { font-size: 28px; }
  </style>
</head>
<body>
  <form>
    <div class="formContainer">
      <h1>Sign Up Form</h1>
      <hr>
      <label for="email"><b>Email</b></label>
      <input type="text" placeholder="Enter Email" name="email" required>
      <label for="password"><b>Password</b></label>
      <input type="password" placeholder="Enter Password" name="password" required>
      <label for="repeatPassword"><b>Repeat Password</b></label>
      <input type="password" placeholder="Repeat Password" name="repeatPassword" required>
      <label>
        <input type="checkbox" checked="checked" name="remember" style="margin-bottom: 15px"> Remember me
      </label>
      <p>By creating an account you agree to our <a href="#" style="color:dodgerblue">Terms & Privacy</a></p>
      <div>
        <button type="button" class="cancel">Cancel</button>
        <button type="submit" class="signup">Sign Up</button>
      </div>
    </div>
  </form>
</body>
</html>

आउटपुट

उपरोक्त कोड निम्नलिखित आउटपुट उत्पन्न करेगा:

HTML और CSS से साइनअप फॉर्म कैसे बनाएं?

मुख्य बिंदु

  • दो बटन स्टाइल - हरा (साइनअप), लाल (कैंसल)
  • बड़े फॉन्ट साइज़ - 28px इनपुट, 18px बटन
  • चेकबॉक्स डिफ़ॉल्ट चेक्ड - रिमेंबर मी ऑप्ट-आउट
  • फोकस पर ग्रे बैकग्राउंड - #ddd से विजुअल फीडबैक
  • HR सेपरेटर - सेक्शन विभाजन के लिए
  1. CSS और JavaScript से ट्री व्यू कैसे बनाएं? CSS और JavaScript से ट्री व्यू कैसे बनाएं?

    CSS और JavaScript से ट्री व्यू बनाने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI&q

  1. CSS और JavaScript से कोट्स स्लाइडशो कैसे बनाएं? CSS और JavaScript से कोट्स स्लाइडशो कैसे बनाएं?

    उदाहरण CSS और JavaScript से कोट स्लाइडशो बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "S

  1. CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं? CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं?

    उदाहरण CSS और JavaScript से एक्सपैंडिंग ग्रिड बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       padding: 1%; &n