npm install foundation-sites
pnpm install foundation-sites
yarn add foundation-sites
bower install foundation-sites
gem install foundation-rails
meteor add zurb:foundation-sites
php composer.phar require zurb/foundation
Here's what comes in the package.
Not a fan of GUIs? The Node-powered Foundation CLI can install the same template projects for you.
Install Foundation CLI:
npm install --global foundation-cli # or sudo npm install --global foundation-cli
EACCESSerror. To get around this, run the commands with
sudoat the beginning.
Then use to create a new Foundation project:
After you selected "Foundation for Sites", Foundation CLI will ask you which template you want to use. You can choose between:
Recommended for beginners
A basic template to begin to use Foundation. It includes:
- Foundation for Sites pre-configured.
A tool to convert your SASS/SCSS files to CSS.
Starter HTML file
A basic file to help you to use basic Foundation component (including the new XY grid !)
Recommended for experienced (or curious) users
A more advanced project including Foundation and a build process with:
- Handlebars HTML templates with Panini
- Sass compilation and prefixing
- Built-in BrowserSync
Foundation 5 users: if you already have the Foundation 5 CLI on your machine, you will only be able to access one of the commands, depending on how your command line environment is configured.
To remove the Foundation 5 CLI, run
gem uninstall foundation. After testing the Foundation 6 CLI, if you want to remove it to go back to the old CLI, run
npm uninstall foundation-cli --global.
Windows users: make sure you've python v2.7 available in your node environment since it's required by the node-gyp tool. There are two way to achieve this
- Install the windows-build-tools (recommended) and make python afterwards accessible via
npm config set python "%USERPROFILE%.windows-build-tools\python27\python.exe"
- Install python (not recommended) and add it to your system environment variables
The first way is recommended if you've not installed pythong v2.7 yet as it doesn't affect your machine outside the node environment. In case you've already installed python v2.7 you may of course skip both ways and start using foundationc-cli immediately.
index.html file for you to hack on. Just unzip and get coding!
<script> tags into your HTML and you're set:
From Foundation 6.4, flex is enabled by default and only the new XY Grid is availaible. However, others CSS versions are availaible for backward compatibility and the most common usage cases. For others uses and advanced customization, we recommand to build Foundation with custom settings (see others installation methods).
<!-- foundation-float.min.css: Compressed CSS with legacy Float Grid --> <link rel="stylesheet" href="https://firstname.lastname@example.org/dist/css/foundation-float.min.css" integrity="sha256-a/iD4AbuBc+h6/0E4L+y6VuHqMeg8qhbxywhoSyT/6o= sha384-tyKVs5ljloBIkDmnTTAGFNx0PBhXOCnxLjBX8bcNHIWNs2xvpIdK832EvxjIteI7 sha512-zQDgIFak5qz0vaDJazJaJcieL/nT2IfaA07e+Uy0ZPpaLKB5IcFSrzSsV6qeJVT/WRPsYAlg6XEf4rharv83Bw==" crossorigin="anonymous"> <!-- foundation-prototype.min.css: Compressed CSS with prototyping classes --> <link rel="stylesheet" href="https://email@example.com/dist/css/foundation-prototype.min.css" integrity="sha256-CoH/ErGK8NbnQi6s9ubiee5FJHzbhqn2agodLgI6l8c= sha384-m0BqrvdGYPAorKYAYrnzaHZaa5s8cR9zh90Quv6WIYPTjDu1ijaZ7qp5KEw05Hk6 sha512-Zlg6N4/YyzM9ouDSVMDg7+jZ9Ei4/24z0MAjQ6tx5Q8Hcq3EUvv7rZeaCcS/g3T1kr+qc5itvGu/D1xmVZkYWA==" crossorigin="anonymous"> <!-- foundation-rtl.min.css: Compressed CSS with right-to-left reading direction --> <link rel="stylesheet" href="https://firstname.lastname@example.org/dist/css/foundation-rtl.min.css" integrity="sha256-kfShcEBdAbQWzxNrtWJykQuMbxl6Pef5nLZzrh07GYY= sha384-t2BhwYwTdmfwidR9N5y7sIoYqfSs+EEV29z9E6y8pnP/7x9VSw+ot3mf+GwcRu/e sha512-jIncOFEZT6MrmJpvjig5XDGfAA9JpXmk0MrHQxdtX+ELuvC+g39wljJ9bKQ9ENJYDj6qs+6z2lB/uwx85pf4pQ==" crossorigin="anonymous">
Start with this HTML template and adapt it to your needs. Be sure to include the
.no-js class on the
html tag of your template. Adding this class prevents flash of unstyled content for a number of foundation components.
<html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Foundation Starter Template</title> <link rel="stylesheet" href="css/foundation.css" /> </head> <body> <h1>Hello, world!</h1> <script src="js/vendor/jquery.js"></script> <script src="js/vendor/what-input.js"></script> <script src="js/vendor/foundation.min.js"></script> <script> $(document).foundation(); </script> </body> </html>
The Foundation community has helped us integrate the framework into Rails, WordPress, Django, and more. Head to our resources page to find even more ways to use Foundation.