Top Banner
What is grid system? ‣The practice of using a grid to guide design and page layout is nearly a century old ‣ In the 1910s and 1920s, ornamental design gave way to Rationalism and New Objectivity ‣ This shift in design was part of a much larger movement towards function over form ‣ Helvetica typeface and Bauhaus architecture
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: What is grid system

What is grid system?

‣The practice of using a grid to guide design andpage layout is nearly a century old

‣ In the 1910s and 1920s, ornamental design gaveway to Rationalism and New Objectivity

‣ This shift in design was part of a much largermovement towards function over form

‣ Helvetica typeface and Bauhaus architecture

Page 2: What is grid system

Grid systems on the web

‣ On the web, grid systems usually take the form of CSS frameworks

‣ A framework is a reusable abstraction of codewrapped in a well-defined API”1

‣ A collection of tools and shortcuts designed tominimize code and make your life easier

Page 3: What is grid system

CSS frameworks

‣ Apply the principles of software frameworks toweb design

‣ They provide standardized rules and shortcuts for: ‣ browser resets ‣ typography ‣ navigation ‣ print style ‣ and...

Page 4: What is grid system

Layout

• When applied to web design, grid systems are CSS

• frameworks that provides standardized rules and

• shortcuts for building a website’s layout

Page 5: What is grid system

Why use a grid system?

1) Saves time2) Saves money

3) Reduces frustration

Page 6: What is grid system

Stop reinventing the wheel

‣ Reduces the amount of CSS and markup you need to duplicate each time you start a project

‣ No need to refer to old projects to figure out how to implement layouts

Page 7: What is grid system

How do grid systems work?

Columns ‣ Grid systems are built using columns ‣ Columns are a grid system’s smallest unitof measurement

‣ Most grid systems contain 12–16 columns

Page 8: What is grid system

Column width

‣ Page regions (header,content, sidebars, etc.)are defined by column width

‣ As in: “The header is eight columns wide”Gutters (margins)

‣ Margins or padding are used to create guttersbetween columns

‣ These gutters provide margins between pageregions

Page 9: What is grid system

Lean and versatile CSS

‣ A grid system’s CSS should: ‣ Be lean and efficient ‣ Be versatile and reusable ‣ Ensure consistent behavior across all commonbrowsers — even IE6

Page 10: What is grid system

Wrapping <div> elements

‣ In fixed-width grid systems, the entire layout iswrapped inside a single <div> element

‣ <div> elements wrap the page regions and definetheir widths according to the number of columnsthey span

‣ These <div> elements may be nested to createregions within regions

Page 11: What is grid system

Floating <div> elements

‣ The wrapping <div> elements are assigneda column width using a CSS class

‣ Because these classes also float the elements,they simply fall into place on the page

Page 12: What is grid system

What can grid systems look like?

Page 13: What is grid system

Other one

Page 14: What is grid system

The Mondriaan

Page 15: What is grid system

How 960.gs works12-column version

Page 16: What is grid system

16-column version

Page 17: What is grid system

Using both versions simultaneously

‣ You can use 12-column classes inside a 16-columngrid — and vice versa

‣ This is possible because 12 and 16 are bothmultiples of 2 and 4

‣ 2 * 6 = 12 2 * 8 = 16‣ ‣ 4 * 3 = 12 4 * 4 = 16‣

Page 18: What is grid system

‣ In other words, when you divide the layout into halves and quarters, you can use 12- and 16- column version simultaneously

‣ Watch what happens when you lay one grid on top of the other:

Page 19: What is grid system

CSS and markup

Containers ‣ Grids must be wrapped in a container <div> ‣ Containers center the content and definewhich version of the grid will be implemented

Page 20: What is grid system

Grids

‣ Grids are held inside containers and arefloated left so they fall into place automatically

‣ They also provide 10px margins on the left andright

Page 21: What is grid system

Grid widths

‣ The width of each grid is determined by thecontainer that wraps it

‣ For example, a one column grid is either60px or 40px depending on whetherit’s a 12- or 16-column layout

Page 22: What is grid system

‣ Note that grid width does not increase by 60px or 40px each time

‣ Each increase must account for the 20px gutter between grids

Page 23: What is grid system

Putting containers and grids together

Page 24: What is grid system

Prefixes and suffixes ‣ If you want to leave space between columns, use a prefix or suffix class

‣ Prefix classes add padding to the left of a column

‣ Suffix classes add padding to the right

Page 25: What is grid system

Adding a prefix and suffix

Page 26: What is grid system

Multiple rows

Page 27: What is grid system

Multiple rows: markup

Page 28: What is grid system

Alpha and omega fix broken nesting

‣ When nesting grids, use the alpha and omegaclasses to remove the margins

‣ alpha removes the left margin. It’s the first nested grid. ‣ omega removes the right margin. It’s the lastnested grid.

Page 29: What is grid system
Page 30: What is grid system

Push and pull classes

‣ Content-first layout can be achieved in Nine Sixty by “pushing” the content grid to the right while “pulling” a sidebar to the left

‣ These classes use the same naming conventionas .grid-X, .prefix-X, and .suffix-X, where X is the grid’s width:

‣ .push-X and .pull-X

Page 31: What is grid system

‣ Push and pull values should match the grid value of the opposite grid

Page 32: What is grid system

Before adding push and pull

Page 33: What is grid system

After adding push and pull

Page 34: What is grid system

When not to use a grid

‣ Implementing a grid will probably be impossible if your site’s layout...

‣ uses irregular column sizes ‣ has irregular margins or gutters ‣ has a width that isn’t divisible by a sane number

Page 35: What is grid system

Thank you