How To Create a Contact Form with CSS

You can create contact form using HTML, CSS and JavaScript. Click Here to Live check

<!--DOCTYPE html--> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body {font-family: Arial, Helvetica, sans-serif;} * {box-sizing: border-box;} .open-button { background-color: #555; color: white; padding: 16px 20px; border: none; cursor: pointer; opacity: 0.8; position: fixed; bottom: 23px; right: 28px; width: 280px; } .form-popup { display: none; position: fixed; bottom: 0; right: 15px; border: 3px solid #f1f1f1; z-index: 9; } .form-container { max-width: 300px; padding: 10px; background-color: white; } .form-container input[type=text], .form-container input[type=password] { width: 100%; padding: 15px; margin: 5px 0 22px 0; border: none; background: #f1f1f1; } .form-container input[type=text]:focus, .form-container input[type=password]:focus { background-color: #ddd; outline: none; } .form-container .btn { background-color: #4CAF50; color: white; padding: 16px 20px; border: none; cursor: pointer; width: 100%; margin-bottom:10px; opacity: 0.8; } .form-container .cancel { background-color: red; } .form-container .btn:hover, .open-button:hover { opacity: 1; } </style> <script> function openForm() { document.getElementById("myForm").style.display = "block"; } function closeForm() { document.getElementById("myForm").style.display = "none"; } </script> </head> <body> <button class="open-button" onclick="openForm()">Enquery Now</button> <div class="form-popup" id="myForm"> <form action="#" class="form-container"> <input type="text" placeholder="Enter Email" name="email" required> <input type="password" placeholder="Enter Password" name="psw" required> <textarea cols="36" rows="4" placeholder="Enter Message" name="psw" required></textarea> <button type="submit" class="btn">Submit Here</button> <button type="button" class="btn cancel" onclick="closeForm()">Close</button> </form> </div> </body> </html>

agyanadda

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 $type={blogger}:

Post a Comment