Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Gym Membership Form</title> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous"> <style> html, body { min-height: 100%; } body, div, form, input, select, p { padding: 0; margin: 0; outline: none; font-family: Roboto, Arial, sans-serif; font-size: 14px; color: #666; line-height: 22px; } h1 { position: absolute; margin: 0; font-size: 36px; color: #fff; z-index: 2; } span.required { color: red; } .testbox { display: flex; justify-content: center; align-items: center; height: inherit; padding: 20px; } form { width: 100%; padding: 20px; border-radius: 6px; background: #fff; box-shadow: 0 0 30px 0 #095484; } .banner { position: relative; height: 180px; background-image: url("/uploads/media/default/0001/01/9e07ce3a601795a5ac09a66a0c1fc8978e0ee51a.jpeg"); background-size: cover; display: flex; justify-content: center; align-items: center; text-align: center; } .banner::after { content: ""; background-color: rgba(0, 0, 0, 0.4); position: absolute; width: 100%; height: 100%; } p.top-info { margin: 10px 0; } input, select { margin-bottom: 10px; border: 1px solid #ccc; border-radius: 3px; } input { width: calc(100% - 10px); padding: 5px; } select { width: 100%; padding: 7px 0; background: transparent; } .item:hover p, .question:hover p, .question label:hover, input:hover::placeholder { color: #095484; } .item input:hover, .item select:hover { border: 1px solid transparent; box-shadow: 0 0 5px 0 #095484; color: #095484; } .item { position: relative; margin: 10px 0; } .question input { width: auto; margin: 0; border-radius: 50%; } .question input, .question span { vertical-align: middle; } .question label { display: inline-block; margin: 5px 20px 15px 0; } .btn-block { margin-top: 10px; text-align: center; } button { width: 150px; padding: 10px; border: none; border-radius: 5px; background: #095484; font-size: 16px; color: #fff; cursor: pointer; } button:hover { background: #0666a3; } @media (min-width: 568px) { .name-item, .city-item { display: flex; flex-wrap: wrap; justify-content: space-between; } .name-item input, .city-item input { width: calc(50% - 20px); } .city-item select { width: calc(50% - 8px); } } </style> </head> <body> <div class="testbox"> <form action="/"> <div class="banner"> <h1>Gym Membership Form</h1> </div> <p class="top-info">Want to become a member of our Gym? Then start by filling our form to complete registration. We will contact you shortly to notify you about your membership card.</p> <div class="item"> <p>Name<span class="required">*</span></p> <div class="name-item"> <input type="text" name="name" placeholder="First" required/> <input type="text" name="name" placeholder="Last" required/> </div> </div> <div class="question"> <p>Gender<span class="required">*</span></p> <div class="question-answer"> <label><input type="radio" value="none" name="gender" required/> <span>Male</span></label> <label><input type="radio" value="none" name="gender" required/> <span>Female</span></label> </div> </div> <div class="item"> <p>Your current weight (lbs)<span class="required">*</span></p> <input type="text" name="name"/> </div> <div class="item"> <p>Desired weight (lbs)<span class="required">*</span></p> <input type="text" name="name" required/> </div> <div class="item"> <p>Height<span class="required">*</span></p> <input type="text" name="name" required/> </div> <div class="item"> <p>BMI<span class="required">*</span></p> <input type="text" name="name" required/> </div> <div class="item"> <p>Home Address<span class="required">*</span></p> <input type="text" name="name" placeholder="Street address" required/> <div class="city-item"> <input type="text" name="name" placeholder="City" required/> <input type="text" name="name" placeholder="Region" required/> <input type="text" name="name" placeholder="Postal / Zip code" required/> <select> <option value="">Country</option> <option value="1">Russia</option> <option value="2">Germany</option> <option value="3">France</option> <option value="4">Armenia</option> <option value="5">USA</option> </select> </div> </div> <div class="item"> <p>Email<span class="required">*</span></p> <input type="text" name="name" required/> </div> <div class="item"> <p>Phone</p> <input type="text" name="name"/> </div> <div class="question"> <p>Do you require a personal trainer?<span class="required">*</span></p> <div class="question-answer"> <label><input type="radio" value="none" name="personal-trainer" required/> <span>Yes</span></label> <label><input type="radio" value="none" name="personal-trainer" required/> <span>No</span></label> </div> </div> <div class="question"> <p>Have you been in a Gym before?<span class="required">*</span></p> <div class="question-answer"> <label><input type="radio" value="none" name="gym-before" required/> <span>Yes</span></label> <label><input type="radio" value="none" name="gym-before" required/> <span>No</span></label> </div> </div> <div class="question"> <p>Membership Type<span class="required">*</span></p> <div class="question-answer"> <label><input type="radio" value="none" name="membership" required/> <span>Regular</span></label> <label><input type="radio" value="none" name="membership" required/> <span>Pro</span></label> <label><input type="radio" value="none" name="membership" required/> <span>VIP</span></label> </div> </div> <div class="btn-block"> <button type="submit" href="/">Apply</button> </div> </form> </div> </body> </html>