Open In App

Foundation CSS Float Left/Right Classes

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.  

In Foundation CSS, Float classes remove the element from the normal flow of the page, and place it at a particular side of its parent element.



Foundation CSS Float Left/Right Classes:

Syntax:



<div class="float-class">
    ...
</div>

Example 1: Below is the example that illustrates the use of the float-left class.




<!DOCTYPE html>
<html>
  
<head>
      <title>Float Left/Right classes</title>
  
    <link rel="stylesheet" href=
    crossorigin="anonymous">
  
    <script src=
    </script>
  
    <script src=
    crossorigin="anonymous">
    </script>
      
</head>
  
<body style="margin: 30rem;">
  <center>
    <h2 style="color: green;">
        GeeksforGeeks
    </h2>
  
    <h3>Foundation CSS Float Left/Right</h3>
  
    <div class="callout clearfix">
      <a class="button float-left success">
        <strong>Left Floated</strong>
      </a>
    </div>
  </center>
</body>
  
</html>

Output:

Example 2: Below is the example that illustrates the use of the float-right class.




<!DOCTYPE html>
<html>
  
<head>
    <title>Float Left/Right classes</title>
  
    <link rel="stylesheet" href=
    crossorigin="anonymous">
  
    <script src=
    </script>
  
    <script src=
    crossorigin="anonymous">
    </script>
      
</head>
  
<body style="margin: 30rem;">
  <center>
    <h2 style="color: green;">
        GeeksforGeeks
    </h2>
  
    <h3>Foundation CSS Float Left/Right</h3>
  
    <div class="callout clearfix">
      <a class="button float-right success">
        <strong>Right Floated</strong>
      </a>
    </div>
  </center>
</body>
  
</html>

Output:

Reference: https://get.foundation/sites/docs/float-classes.html#float-left-right


Article Tags :