Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Foundation Getting Started

Foundation Getting Started


What is Foundation?

| Note | **What is responsive web design?
**
The idea of responsive web design is that page design and development should respond and adjust according to user behavior and device environment (system platform, screen size, screen orientation, etc.). | | --- | --- |


Where to download Foundation?

You can get Foundation in the following two ways:

1. Download the latest version from the official website:http://foundation.zurb.com/。

2. Use the CDN provided by Staticfile (recommended):

























This site's static CDN is based on Aliyun services.

| Note | Advantages of using CDN for Foundation:
Using CDN for Foundation improves the access speed of enterprise sites (especially sites with many images and static pages) and greatly improves the stability of such sites

 **为什么使用 modernizr?**       

 Some Foundation 的组件使用了比较前前沿的 HTML5 和 CSS3 特性,但不是所有浏览器都支持。 Modernizr 是一个用于检测用户浏览器HTML5和CSS3特性的JavaScript库 - 让组件能在所有浏览器上正常运行。 |

| --- | --- |


Creating Pages with Foundation

1. Add HTML5 doctype

Foundation uses HTML elements and CSS properties, so you need to add the HTML5 doctype declaration.

At the same time, we can set the document's language attribute lang and character encoding:

<

!DOCTYPE

html

<

html

lang=

"zh-cn"

<

head

<

meta

charset=

"utf-8"

<

/head

<

/html

2. Foundation 5 Mobile First

Foundation 5 is responsive design for mobile devices. The core of the framework is mobile first.

To ensure the page can be freely scaled, you can add in the element the following tag:

<

meta

name=

"viewport"

content=

"width=device-width, initial-scale=1"

3. Initialize Components

Some Foundation components are developed based on jQuery, such as modals, dropdowns, etc. You can use the following script to initialize the components:

<

script

$(document).ready(function() {

    $(document).foundation();

})

<

/script


Basic Foundation Page

How to create a basic Foundation page:

Foundation Example

<div class="row">
<div class=">

medium-12 columns

"

<div class="panel">
<h1>

Foundation Page

h1

<

p

Resize the window to see the effect!

p

<button type="button" class=">

button small

"

I am a button!

button

div

div

div

<div class="row">
<div class=">

medium-4 columns

"

<

h3

Runoob Tutorial

h3

<

p

What you learn is not just technology, but also dreams!!!

p

div

<div class=">

medium-4 columns

"

<

h3

Runoob Tutorial

h3

<

p

What you learn is not just technology, but also dreams!!!

p

div

<div class=">

medium-4 columns

"

<

h3

Runoob Tutorial

h3

<

p

What you learn is not just technology, but also dreams!!!

p

div

div

Try it »