Open In App

Foundation CSS Kitchen Sink Forms

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 Fast click.js tool for faster rendering on mobile devices.

Kitchen Sink has the foundation elements to work well in our websites and applications. The Kitchen Sink Forms is used to create a responsive form layout using the combination of foundation grid and the form styles.



Foundation CSS Kitchen Sink Forms classes:

Syntax:



<form>
   <input type="...">
    .............
</form>

Example 1: The below example illustrates the use of Kitchen Sink Forms using foundation classes.




<!DOCTYPE html>
<html lang="en">
  
<head>
  <title>Foundation CSS Kitchen Sink Forms</title>
  
  <!-- Compressed CSS -->
  <link rel="stylesheet" href=
  
  <!-- Compressed JavaScript -->
  <script src=
  </script>
</head>
  
<body style="margin-inline: 40rem;">
    <center>
      <h2 style="color:green">
        GeeksforGeeks
      </h2>
  
      <h3>Foundation CSS Kitchen Sink Forms</h3>
    </center>
  
    <form class="callout">
      <label>Name
        <input type="text" placeholder="input name" 
         aria-describedby="gfg-name">
      </label>
        
      <p class="help-text" id="gfg-name">
        You can input some text in the field above
      </p>
  
  
      <label>Number
        <input type="number" value="0">
      </label>
  
      <label>Select subject
        <select>
          <option value="">Subject</option>
          <option value="DSA">DSA</option>
          <option value="OS">OS</option>
          <option value="DBMS">DBMS</option>
          <option value="OOP's">OOP's</option>
        </select>
      </label>
  
      <label>Message
        <textarea placeholder="message"></textarea>
      </label>
        
      <input type="submit" class="button" value="SUBMIT">
    </form>
  
    <script>
        $(document).foundation();
    </script>
</body>
  
</html>

Output:

Foundation CSS Kitchen Sink Forms

Example 2: Below is another example that illustrates the use of Kitchen Sink Forms using a foundation grid system.




<!DOCTYPE html>
<html lang="en">
  
<head>
  <title>Foundation CSS Kitchen Sink Forms</title>
  
  <!-- Compressed CSS -->
  <link rel="stylesheet" href=
  
  <!-- Compressed JavaScript -->
  <script src=
  </script>
</head>
  
<body style="margin-inline: 30rem;">
    <center>
      <h2 style="color:green">
        GeeksforGeeks
      </h2>
  
      <h3>Foundation CSS Kitchen Sink Forms</h3>
    </center>
      
    <form class="callout">
      <div class="grid-x grid-margin-x">
        <div class="cell large-6">
          <label for="label" class="text-right">
            Name
          </label>
        </div>
  
        <div class="cell large-6">
          <input type="text" id="label" 
           placeholder="Enter your name">
        </div>
      </div>
      <br><br>
        
      <div class="grid-x grid-margin-x">
        <fieldset class="cell large-6">
          <legend>Choose Your Subject</legend>
          <input type="radio" name="gfg" 
            id="gfg-1" required>
          <label for="gfg-1">DSA</label>
  
          <input type="radio" name="gfg" id="gfg-2">
          <label for="gfg-2">OOP's</label>
        </fieldset>
  
        <fieldset class="cell large-6">
          <legend>Check these Courses</legend>
          <input type="checkbox" id="course-1">
          <label for="course-1">
            DSA - Self Paced
          </label>
  
          <input type="checkbox" id="course-2">
          <label for="course-2">
            Interview Preparation
          </label>
        </fieldset>
      </div>
      <br><br>
      <input type="submit" class="button success" value="SUBMIT">
    </form>
</body>
  
</html>

Output:

Foundation CSS Kitchen Sink Forms

Reference: https://get.foundation/sites/docs/kitchen-sink.html#forms


Article Tags :