Basics

优质
小牛编辑
128浏览
2023-12-01

描述 (Description)

Flex网格结构类似于浮动网格。 .row类用于行, .column用于列。 对于不同的屏幕尺寸,在柔性网格中也使用相同类别的网格,即small-*, medium-*和大large-*

例子 (Example)

以下示例演示了在Foundation中使用Basic flex grid -

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
   </head>
   <body>
      <h2>Example of Flex Grid</h2>
      <div class = "row">
         <div class = "small-4 columns" style = "background-color:#8BD6EE;">Small 4</div>
         <div class = "small-4 columns" style = "background-color:#FF6347;">Small 4</div>
         <div class = "small-4 columns" style = "background-color:#8BD6EE;">Small 4</div>
      </div>
      <div class = "row">
         <div class = "medium-6 large-9 columns" style = "background-color:#C0B0F0;">
            Medium 6/ Large 9
         </div>
         <div class = "medium-6 large-3 columns" style = "background-color:#7B68EE;">
            Medium 6/ Large 3
         </div>
      </div>
   </body>
</html>