Foundation Grid - Medium Appliance


In the previous chapter we introduced that on small devices we use the .small-* class to set the grid ratio to 25%/75%:

<div class="small-3 columns">....</div>
<div class="small-9 columns">....</div>

On medium-sized devices our recommended ratio is 50%/50%.

Tip: The screen size for medium-sized devices is defined between 40.0625em and 64.0624em.

Use the .medium-* classes on medium devices.

Now we add two columns on the medium device:

<div class="small-3 medium-6 columns">....</div>
<div class="small-9 medium-6 columns">....</div>

The above example sets two columns with a ratio of 25 % and 75% (Foundation is mobile first: if not specified, the code of the .small class will be inherited on large devices):

The ratio used on small devices is 25%/75% ( .small-3 and .small-9). But on mid-range devices it's 50%/50% (.medium-6 and .medium-6) .

Instance

<!DOCTYPE html>
<html>
<head>
  <title>Foundation 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css">
  <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script>
</head>
<body>

<div class="row">
  <h2>Foundation 网格</h2>
  <p>中型或大型设备上是 50%/50% 比例 ,小型设备上比例是 25%/75%。</p>
  <p>Resize the browser window to see the effect.</p>
  <div class="small-3 medium-6 columns" style="background-color:yellow;">
    <p>php中文网</p>
  </div>
  <div class="small-9 medium-6 columns" style="background-color:pink;">
    <p>php中文网</p>
  </div>
</div>

</body>
</html>

Run instance»

Click the "Run instance" button to view the online instance

Note##Note: Make sure the number sequence adds up to 12 columns!

Use closely on medium devices

In the following example we specify the

.medium-6 class (not .small-*). This indicates a 50%/50% ratio on a medium or large device. But on small devices it stacks horizontally (100% width):

Instance

<!DOCTYPE html>
<html>
<head>
  <title>Foundation 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css">
  <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script>
</head>
<body>

<div class="row">
  <h2>Foundation 网格</h2>
  <p>中型或大型设备上是 50%/50% 比例 ,小型设备上是水平堆叠 (100%).</p>
  <p>重置浏览器窗口大小查看效果。</p>
  <div class="medium-6 columns" style="background-color:yellow;">
    <p>php中文网</p>
  </div>
  <div class="medium-6 columns" style="background-color:pink;">
    <p>php中文网</p>
  </div>
</div>

</body>
</html>

Running Instance»Click the "Run Instance" button to view the online instance