A Detailed Look at the 960 CSS Framework
videos

A Detailed Look at the 960 CSS Framework

CSS frameworks are bloated. CSS frameworks are for people who don’t know how to code. CSS is too simple to implement a framework.

If you’ve ever read a tutorial on a CSS framework, I can guarantee that many comments mimic the previous statements. My guess is that the majority of these comments are stemmed from slight ignorance. Once you take the opportunity to spend some time with 960, you’ll be amazed at how much time can potentially be saved when developing your web applications. At the very least, take ten minutes to review the framework. You can always press the delete key…though I doubt you will!

960 Framework

Pros

  • Rapidly speeds up development time.
  • Clean grid structure.
  • Not many browser inconsistencies. The ones you find can be fixed easily.
  • It’s not “bloated” as many people suggest. We’re talking 3-4kb here, folks! You would use many of these stylings anyways.
  • Build complex layouts quickly.

Cons

  • It’s named “960″ for a reason. If you’re hoping to use a different width for you website, you might be better off choosing a different framework.
  • As with any “framework”, you lose a bit of flexibility.
  • You didn’t create it. There’s something to be said for code being 100% our own.

Usage

Let’s imagine that we want to work with the “12 column” structure to create the extremely simple layout seen below. First, we must create a wrapper div that has a class of “container_12″. Notice the 12.

layout
<div id="container" class="container_12">
...content goes here
</div>

Specifying an id here isn’t required by any means. However, I find that it helps me to remember exactly what the div is. One of the gripes against 960 is that the classes do nothing to define what the element is. Simply including an id fixes that issue.

Grids

Now we want to create a simple header and two column structure. When first getting started, it’s helpful to examine the demo to choose how wide a grid you should use.

960 Framework

I’m going to choose a header width of “940px” (+ 20px margins = 960), a sidebar width of “220px”, and a main content width of “700px”.

You must assign a class to each div. Naming conventions require that that the class name begins with “grid_” and ends with the number of columns needed. In our case, we’ll use “grid_12′, “grid_3″ and “grid_9″, respectively.

<div id="container" class="container_12">
  <div id="header" class="grid_12">
    content goes here
  </div>

  <div id="sidebar" class="grid_3">
    content goes here
  </div>

  <div id="mainContent" class="grid_9">
    content goes here
  </div>
</div>

The only additional styling that I’ve added is background colors and a minimum width for each div to simulate an actual website full of text. I won’t go over that here; mostly because they should be removed. They’re only used here to demonstrate the structure.

Without worrying about margins, floats, or IE hacks, we’re able to create a layout extremely fast. The true power of 960 is demonstrated when building complex newspaper-like layouts. For more detail, be sure to watch the screencast above.

960 Framework

You Also Might Like

  • Prototyping With The Grid 960 CSS Framework`

    Prototyping With The Grid 960 CSS Framework

    Grid 960 is a CSS Framework that enables developers to rapidly prototype designs. They are excellent tools for creating mock ups. Why? Because they do all the heavy lifting allowing you to get faster results.

    Visit Article

  • Build a Newspaper Theme With WP_Query and the 960 CSS Framework

    Build a Newspaper Theme With WP_Query and the 960 CSS Framework

    WP_Query is a powerful tool to control what comes out of your loop. Today I’m going to teach you all how to use it to make a 3 columned newspaper theme that has all your main blog posts in the main column, and off to the side a set of posts with a certain category. We’ll be using the 960 CSS framework for the basic layout and reset of our theme, it will chop a lot of work off what’s needed!

    Visit Article

  • Which CSS Grid Framework Should You Use for Web Design?

    Which CSS Grid Framework Should You Use for Web Design?

    Ever wondered how all those slick “magazine” themes for WordPress and other platforms were created? Many, if not all, were designed using a CSS Grid Framework – at least in essence if not in actual fact. That is, you can use an existing CSS framework or build your own from scratch. While it’s possible to design complex web page layouts without a framework, it’s arguably an act in masochism. In this article you’ll get an overview of the current batch of Frameworks and which you should choose to use.

    Visit Article

  • Subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.


Tags: Videos
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.yatak-odasi.com yatak odası

    Thnx yatak odası

  • Pingback: Praj's Blog » Web Development Screencasts

  • Pingback: Praj's Blog » 960 Grid System

  • Simon

    Thanks. Needed a brush up on how this works as using it in work next week!

    Jeff love this site! keep up the sterling work!

  • http://www.sarahlestudio.com sarah le

    Great tutorial! I’ve been watching it a few times already. Thanks for posting!

    Have a question though, what if the content has several “sub content” areas that are nested within a parent area, how do you “class” those? It could get quite confusing the deeper the site.

    Thanks!

  • Pingback: Technology Research « Kristen's Blog

  • http://www.shawie.com Filipino Web Designer

    Man, this is awesome tutorial. I’m doing CSS in hard way and when I watched the video, damn, i hate myself LOL.

    Thanks for sharing this 960 gs tutorial, it will help a lot on my wordpress, joomla and drupal theming.

  • wara

    nice tutorial!!

    Unfortunately, the most tutorial videos haven’t sub-describe for another country. I might spending time a lot to assume what they say.

  • OrehWareh

    All I gotta say is that CSS is not that hard, using a framework is just adding to the bloat of the website.
    CSS frameworks are very bloated. Don’t believe the hype folks.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      2k is bloated?

      • OrehWareh

        Indeed, that’s 2048 bytes we’re talking about. With the average computer having 2 gigabytes of ram, which works out to around 2147483648 bytes if I’m not mistaken – if we use a CSS framework we’d hardly be left with exactly the same thing, never minding the pittance of memory our OS of choice takes and other processes. 2k bytes spent on a CSS framework, with the only benefit of saving some time for experienced web developers who want to bang out web pages/apps as quickly as possible? I don’t think it’s either morally or pragmatically justifiable. No sir, it’s my firm belief that people should keep filling forums with discussions regarding the bloat of CSS / Javascript frameworks, among other very bloated things of no consequence. We have to think about all those people accessing the web using punching card computers – in the name of accessibility and standards!

        Great tutorial by the way – 2 thumbs up.

      • Martin Sjåstad

        You are going to have to subtract your own special css layout from the grid framework, and in the end you will probably end up with say 1kb of actual framework stuff or less.

        How big css files do you usually work with?

  • carl

    This is quite amazing stuff, aint got a clue about css like, but looks fairly good, thanks for the vid, good job explaining it :)

  • http://www.rebeccaquinlan.com BeckieQ

    Great tutorial, thanks so much!

  • http://www.timolthof.com Sydney Web Designer

    I never though about using a CSS frame work until it was mentioned in a job requirement. Now that you’ve shown the benefits I’ll give it a go for sure. I wonder how it would work if I needed 5 columns within a column that only fit 4 for example in this grid system..

  • Jeroen

    Very nice tutorial!

  • Leigh Herbert

    Great video, a nice introduction to 960. Thanks a lot!

  • Jeff Kes

    I love this tutorial. You always have good tutorials Jeffrey.

    One side note where did you get that cool wuicklaunch bar on your desktop at the top? Does it work with Windows 7?

    Thanks again and keep up the great work,
    Jeff

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      I think it was called RocketDock. :P

  • http://www.risingperfection.com Arun R

    It is simple and clean.Thanks for your effort and time.

  • Shristi

    Its indeed a great tuorial…..
    It makes CSS easy!!
    :-)
    thank u!!

  • Dale Cooper

    Terrific, it gonna makes me save so much time! Thanks a lot for this tutorial!

  • http://www.mgpwr.co.uk Mark Petherbridge

    Thanks, This is an awesome tutorial and has inspired me to start using a grid system.

    @mgpwr

  • http://blogg.attefall.se Magnus Attefall

    Excellent video! *impressed*
    Well… Now I know what to do this weekend… ;-)

  • Pingback: Investing in the Grid | Design Reviver

  • http://icodepixels.com Jason

    Great Post! I’m going to start using this 960 grid!

  • Pingback: CSS Grid-Systeme und Grid-Generatoren für Webdesigner | Elmastudio

  • http://www.deposit-poker-bonus.com/ Dan Green

    Simply amazing!Grat job on the article guys.

  • http://www.futso.pl/ Futso

    Great tutorial. Very well explained. Thank you.

  • meyer@s8n

    what if the client wants a different layout?

    • Rodrigo Ribeiro de Abreu

      I think you and the client should choose the final layout before starting the html.
      Anyway, if the cliente change his mind, wich is very commom to happens, the didifult in redesign (at least for me) is the same as if there is no css framework at all.
      I think there is 2 things that’s is a bit confusing for me:

      1 – The class of a html element is intrinsically attached with the layout. For exemple, lets say you have a “.sidebar” which is 240px. If you want to change that width later, you just have to change de css file. Using 960gs you cannot alter the css width of a “.grid_3″ class. You must change the html file to a “.grid_4″ class.

      2 – If you put an one pixel border in a full filled columns layout, that extra (2px) will make the sequencial divs to ‘float’ down

  • http://www.nova-media.fr maria saTine

    C’est genial ce type de structure ; il fallait l’inventer

  • Pingback: 960 CSS Framework « Oscar Viana's Weblog

  • Richard

    I must say it is a good introduction to 360 grid, but I think it is too basic. I don’t think you are very skilled and thus chose the easy way. This tut is 26 mins, but with 10 extra mins you could easily show some more and harder stuff, completing the tut.
    26 min slighly well spent, but I would have preferred spending some more time for the harder stuff

    • MG

      Maybe you missed the part where he said it’s an intro to the 960 grid. INTRO in english means that it’s basic. Now get off the couch and since you got the intro and do some work on your own to figure out the hard stuff. I mean how hard is it to read css, of course if you know it.

  • K

    Thanks for the great tutorial man! :)

  • Pingback: The Big Boy MVC Series — Part 15: Creating an Asp.Net MVC Master Page « weirdlover

  • Debbie

    Thank you so much for this tutorial! I was trying some written tutorials but just couldn’t get my head around it….you made it all very clear! Thanks again!

  • Pingback: L’invité #6: Jonas Luthi - Lafoireolien.com

  • http://vivianskvetch.blogspot.com Vivian

    Thanks, Jeffrey, that was excellent.

    There are a couple of things you didn’t touch upon that still confuse me: why the “push” and “pull” classes are necessary, and what “clear” and “clearfix” do exactly. But then, I’m not very experienced with CSS and therefore should not even be looking at 960. :-) Only I have to because I downloaded a Drupal theme based on it.

  • Pingback: 30 HTML Best Practices for Beginners | ink9 blog | Web Design Tutorials

  • Pingback: Driving the 960 Grid System

  • mabel

    hello!

    i really wanted to see this tutorial, but it was impossible! i thought that it was my connection, but i tried to see any video in youtube and i could!! – so, is not my connection- please, if you have a copy in youtube, vimeo or somewhere else, share it to me! because i red the comments and i am really interested to watch it !

    thank you for your answer, and to share the knowledge.

    mabel.

  • Pingback: 960 Grid System | Startup Addict Musings

  • Rasmus

    Nice – this tutorial really helped me understand, how to use the 960 grid : )

  • http://www.crunchypickle.com Kevin

    I love your tutorial, but have to say this is driving me crazy. It actually has to do with your Desktop widget. I can’t find a horizontal scrollable taskbar for Windows 7 anywhere. I guess it’s nice that my taskbar is 1920 across a 23 inch widescreen, but even so I’d really like to have it =/

  • David

    For any who are looking for an alternative to the 960 grid, there is a much much easier one. It is called easyframework. I found it to be one of the easiest frameworks I have ever come across. The framework includes the 3 layers that are used most by developers structural, presentational, and interactive.

  • http://www.baseworks.nl/ Wouter Vervloet

    I haven’t seen this in the comments yet, so I thought I’d mention it…

    If you still think the 960 CSS file is still too bloated, you can almost cut it down to half the size by removing the lines you don’t need. For example: If you’re using the 12 column grid (which is most of the time in my case) you can remove all of the lines of the 16 column grid. That will easily shave off 3kb’s of the uncompressed file (7kb).

    It also comes with a lot of “extra” lines of CSS to do some special operations like pushing a column to the left or right (push/pull) and filling empty columns (prefix/suffix). If you’re not using those, you can remove those as well which will leave you with a file 1/3rd the size of the original.

    You need to remember that a framework is a starting point, not a do-all solution. You can adept it to your needs and those of the project.

    I usually add a block of styles with classes like .container_xx which are the same width as the grid_xx equivalent but withouth the margins and including the those in the width of the column.

    This will give you some extra tools when you need to style something in the gutters…

    .grid_3 { width:60px; }
    .container_3 { width:80px; margin-left:0;margin-right:0; }

    Greetz,
    Wouter

  • Pingback: 30+ Killer Web Development Screencasts to fine tune your skills | luLUXE

  • Pingback: 20个使Web开发变得更轻松的制作工具 : 艾磊科技-电脑维护每周一报

  • Pingback: Mastering the 960 Grid System « Blue Tuts CODING – DESIGN – FLASH – CSS – HTML – MYSQL – MOBILE – TUTORIALS

  • Pingback: links for 2010-08-18 | Tombola!

  • Pingback: Stoff für das Wochenende #3 | daswebdesignblog.de :: Artikel, Tutorials, Freebies und Interviews

  • Pingback: Mastering the 960 Grid System | Nettuts+ | Web Design - HTML Website

  • Pingback: 960 Grid System « You + Me

  • Leandro Falanga

    Background color for #container is not working with the last version of 960 Grid System? Can you plaese tell me why?