Foundation - Flex Grid Source Ordering



Source ordering helps to rearrange the column in different size of screens. Using the order property, the columns are sorted into the row, i.e. the lowest number is arranged at the first place.


The following example demonstrates the use of Source Ordering in Foundation −

<!DOCTYPE html>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <title>Foundation Template</title>
      <link rel = "stylesheet" href = "css/foundation.css" />
      <script src = "js/vendor/jquery.min.js"></script>
      <script src = "js/foundation.min.js"></script>

      <h2>Example of Flex Grid</h2>
      <div class = "row">
         <div class = "column order-1 medium-order-2" style = "background-color:#8BD6EE;">
            Appears first on small screen
         <div class = "column order-2 medium-order-1" style = "background-color:#7B68EE;">
            Appears second on small screen


Let us carry out the following steps to see how the above given code works −

  • Save the above given html code flex_grid_source_ordering.html file.

  • Open this HTML file in a browser, an output is displayed as shown below.