本文共 10164 字,大约阅读时间需要 33 分钟。
zurb是什么网站
ZURB's has a ton of great features. The one that you will probably use the most in your own websites and applications is the . If you are coming from a background, you may be familiar with that already and love its ease of use and functionality.
Today we'll be looking at Foundation 5's grid system and all the great features it has. Foundation hasZURB的具有许多出色的功能。 可能是您在自己的网站和应用程序中使用最多的一种 。 如果您来自背景,那么您可能已经熟悉该并且喜欢它的易用性和功能。
今天,我们将研究Foundation 5的网格系统及其所有强大的功能。 Foundation的 class names that are a little different than Bootstrap, but work in the same way. It also has some neat 类名与Bootstrap略有不同,但工作方式相同。 它还具有一些简洁的 advanced features and great 高级功能和出色的 visiblity classes to show and hide elements based on the situation. Let's jump right in and start using the Foundation grid system. 可见性类,可以根据情况显示和隐藏元素。 让我们直接进入并开始使用Foundation网格系统。one-thirdone-thirdone-third
See the Pen by Chris Sevilleja () on .
This will generate 3 columns. Notice how there is a max-width set for the row. Unlike Bootstrap, we won't have to encompass our rows inside of a.container
class. .row
class. Easy enough. The columns are created using the css classes: .small-#
, .medium-#
, and .large-#
. The #s have to add up to be 12 since Foundation uses a 12 grid system. Also, a class that has to be attached to columns is .column
or .columns
. They both do the same thing. You can define any combination of layouts using the .row
and .small/medium/large-#
classes. The show a great deal of examples, so take a look over there for inspiration. If you need more help like having prebuilt pages and rows for you, take a look at . These are a great starting point. ems
and not pixels
. These media queries can be found on the . Take a look at the media queries and the comments to understand how Foundation breaks down our site. .row
inside of a .column
and build out your grid like you normally would. Here's some code and an example: one-thirdhalf of one-thirdhalf of one-thirdone-third
See the Pen by Chris Sevilleja () on .
请参阅上的Chris ( ) 的Pen 。
这将生成3列。 注意如何为该行设置最大宽度。 与Bootstrap不同,我们不必将行包含在.container
类中。 .row
类定义的。 很简单。 这些列是使用CSS类创建的: .small-#
.medium-#
和 .large-#
。 由于Foundation使用 12个网格系统,因此#的总数必须为 12 。 同样,必须附加到列的类是 .column
或 .columns
。 他们俩都做同样的事情。 您可以使用 .row
和 .small/medium/large-#
类定义布局的任意组合。 该 显示了大量示例,因此请查看那里的启发。 如果您需要更多帮助,例如为您预建页面和行,请查看 。 这些是一个很好的起点。 ems
而不是 pixels
定义的。 这些媒体查询可以在 。 查看媒体查询和评论,以了解Foundation如何分解我们的网站。 // Small screens@media only screen { } /* Define mobile styles *//* max-width 640px, mobile-only styles, use when QAing mobile issues */@media only screen and (max-width: 40em) { } /* ------------------------------------------ Medium screens min-width 641px, medium screens */ ------------------------------------------@media only screen and (min-width: 40.063em) { } /* min-width 641px and max-width 1024px, use when QAing tablet-only issues */@media only screen and (min-width: 40.063em) and (max-width: 64em) { } /* ------------------------------------------ Large screens min-width 1025px, large screens */ ------------------------------------------@media only screen and (min-width: 64.063em) { } /* min-width 1025px and max-width 1440px, use when QAing large screen-only issues */@media only screen and (min-width: 64.063em) and (max-width: 90em) { } /* ------------------------------------------ XLarge screens min-width 1441px, xlarge screens*/ ------------------------------------------@media only screen and (min-width: 90.063em) { }/* min-width 1441px and max-width 1920px, use when QAing xlarge screen-only issues */@media only screen and (min-width: 90.063em) and (max-width: 120em) { } /* ------------------------------------------ XXLarge screens min-width 1921px, xxlarge screens*/ ------------------------------------------@media only screen and (min-width: 120.063em) { }
.row
一个内部 .column
,打造出网格就像你通常会。 这是一些代码和示例: 请参阅上Chris ( ) 的Pen 。
.small
, .medium
, and .large
classes, we are able to define different grids at different sizes. Let's say to have 2 columns on small devices and 3 columns on medium and large devices. We can do this by defining multiple classes on the same column. column 1column 2only shows on medium and up
See the Pen by Chris Sevilleja () on .
By resizing your browser, you can see the different configurations that we have defined..end
class to your last column. See the Pen by Chris Sevilleja () on .
.small-offset-#
, .medium-offset-#
, or .large-offset-#
) we are able to "offset" a column that many spaces. column 1column 2go right
See the Pen by Chris Sevilleja () on .
.small-centered
or .large-centered
classes. Also, if you center something on small devices but want it to be normal on large devices, just add .large-uncentered
. See the Pen by Chris Sevilleja () on .
.small
, .medium
和 .large
类,我们可以定义不同大小的不 .large
格。 假设 在小型设备上有 2列, 在中型和大型设备上有3列 。 我们可以通过在同一列上定义多个类来做到这一点。 见笔克里斯Sevilleja( 上) 。
通过调整浏览器的大小,您可以看到我们定义的不同配置。.end
类添加到最后一列。 column 1column 2go rightcolumn 1column 2stay here
请参阅上的Chris ( ) 的Pen 。
.small-offset-#
offset .small-offset-#
.medium-offset-#
或 .large-offset-#
),我们可以“偏移”具有很多空格的列。 请参阅上Chris ( ) 的Pen 。
.small-centered
或 .large-centered
类在Foundation中可以轻松完成此 .small-centered
。 另外,如果您将某些内容放在小型设备上但希望在大型设备上正常显示,则只需添加 .large-uncentered
。 请参阅上的Chris ( ) 的Pen 。
.show-for-small-only
.show-for-medium-up
.show-for-medium-only
.show-for-large-up
.show-for-large-only
.show-for-xlarge-up
.show-for-xlarge-only
.show-for-xxlarge-up
.hide-for-small-only
.hide-for-medium-up
.hide-for-medium-only
.hide-for-large-up
.hide-for-large-only
.hide-for-xlarge-up
.hide-for-xlarge-only
.hide-for-xxlarge-up
.show-for-landscape
.show-for-portrait
.show-for-touch
.hide-for-touch
.show-for-small-only
.show-for-medium-up
.show-for-small-only
.show-for-medium-up
.show-for-medium-only
.show-for-large-up
.show-for-medium-only
.show-for-large-up
.show-for-large-only
.show-for-xlarge-up
.show-for-large-only
.show-for-xlarge-up
.show-for-xlarge-only
.show-for-xxlarge-up
.hide-for-small-only
.hide-for-medium-up
.hide-for-medium-only
.hide-for-large-up
.hide-for-large-only
.hide-for-xlarge-up
.hide-for-xlarge-only
.hide-for-xxlarge-up
.show-for-landscape
.show-for-portrait
.show-for-touch
.hide-for-touch
翻译自:
zurb是什么网站
转载地址:http://icywd.baihongyu.com/