Open In App

Foundation CSS Forms

Last Updated : 14 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.

Forms on a web page allow a user to enter data that is sent to a server for processing. Forms can resemble paper or database forms and provides the user to fill in various types of input fields such as text type, password type, number type, email type, or maybe some other type of input. Forms are generally used when you want to collect data from the user. For example, a user wants to buy a bag online, so he/she has to first enter their shipping address in the address form and then add their payment detail in the payment form to place an order.

Example 1: In this example, we create a registration form.

HTML




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Forms</title>
    <link rel="stylesheet" href=
        crossorigin="anonymous">
    <style>
        body {
            margin: 5px;
        }
    </style>
</head>
 
<body>
    <h3 style="color:green"><b>GeeksforGeeks</b></h3>
    <h5>This is Foundation CSS Forms tutorial</h5>
    <form action="backend.php">
        <label for="name"> Name</label>
        <div>
            <input type="text"
                   name="myName" id="name">
        </div>
 
        <label for="Email">Email</label>
        <div>
            <input type="email"
                   name="myEmail" id="Email">
        </div>
 
        <label for="number">Mobile Number</label>
        <div>
            <input type="number"
                   name="mynumber" id="number">
        </div>
        <div>
            Gender: Male <input type="radio"
                                name="myGender">
            Female <input type="radio"
                          name="myGender">
            Other <input type="radio"
                         name="myGender">
        </div>
        <label for="registration"
               class="button">Register</label>
    </form>
</body>
 
</html>


Output:

registration form

Example 2: In this example, we create a normal form.

HTML




<!doctype html>
 
<head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible"
          content="ie = edge" />
    <meta name="viewport"
          content="width = device-width, initial-scale = 1.0" />
 
    <title>Forms</title>
    <link rel="stylesheet" href=
        crossorigin="anonymous">
    <style>
        body {
            margin: 5px;
        }
    </style>
</head>
 
<body>
    <h3 style="color:green"><b>GeeksforGeeks</b></h3>
 
    <form>
        <label>Input Label
            <input type="text"
                   placeholder="enter your text">
        </label>
        <p class="help-text">This is help text..</p>
        <label>
            <textarea placeholder="This is text area"></textarea>
        </label>
 
        <label>Select Menu
            <select>
                <option value="india">India</option>
                <option value="Pakistan">Pakistan</option>
                <option value="china">China</option>
                <option value="Australia">Australia</option>
            </select>
        </label>
 
        <div class="row">
            <fieldset class="small-6 columns">
                <legend>Your Favorite sport?</legend>
 
                <input type="radio" name="fruit"
                       value="kabaddi">
                <label for="sportkab">kabaddi</label>
 
                <input type="radio" name="fruit"
                       value="cricket">
                <label for="sportcrick">cricket</label>
            </fieldset>
 
            <fieldset class="small-6 columns">
                <legend>Choose your car?</legend>
                <input id="checkbox1" type="checkbox">
                <label for="checkbox1">Audi</label>
 
                <input id="checkbox2" type="checkbox">
                <label for="checkbox2">Civic Honda</label>
 
                <input id="checkbox3" type="checkbox">
                <label for="checkbox3">Suzuki</label>
            </fieldset>
        </div>
 
        <div class="input-group">
            <a class="input-group-button button">Submit</a>
        </div>
    </form>
</body>
 
</html>


Output:

 

Reference: https://get.foundation/sites/docs/forms.html



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads