中心列(Centered Columns)

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

描述 (Description)

包括以small-centered的类,您可以将列放在中心。 large-centered类用于在大型设备中居中列。 要在大型设备或屏幕中取消输入列,请包含large-uncenter类。

例子 (Example)

以下示例演示了在基础中使用Centered Columns -

<!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>Centered Columns</h2>
      <div class = "row">
         <div class = "small-2 small-centered columns" style = "background-color:#8BD6EE;">
            Small centered
         </div>
      </div>
      <div class = "row">
         <div class = "small-4 small-centered columns" style = "background-color:#C0B0F0;">
            Small centered
         </div>
      </div>
      <div class = "row">
         <div class = "small-6 small-centered large-uncentered columns" style = "background-color:#808000;">
            Large uncentered
         </div>
      </div>
      <div class = "row">
         <div class = "small-8 small-centered columns" style = "background-color:#FF6347;">
            Small centered
        </div>
      </div>
      <div class = "row">
         <div class = "small-10 large-centered columns" style = "background-color:#7B68EE;">
            Large centered
         </div>
      </div>
   </body>
</html>