Open In App

Foundation CSS Float Left/Right Classes

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.  

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:

  • float-left: This class removes the element from the normal flow of the web page and makes it float on the inner left side of the container.
  • float-right: This class removes the element from the normal flow of the web page and causes it to float on the inner right side of the container.
  • clearfix: This class removes the float if we add it in the parent element.

Syntax:

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

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

HTML




<!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.

HTML




<!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



Last Updated : 09 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads