Try Tuts+ Premium, Get Cash Back!
Getting Started With Dreamweaver CS6 Fluid Grids
videos

Getting Started With Dreamweaver CS6 Fluid Grids

Tutorial Details
  • Topic: Dreamweaver CS6 Fluid Layouts
  • Difficulty: Beginner
  • Screencast duration: 15 mins
This entry is part 1 of 3 in the series Dreamweaver CS6 Fluid Grids

Today I’m going to introduce you to Adobe’s take on Responsive Web Design; Fluid Layouts in Dreamweaver CS6. These new tools allow designers to visually build their responsive layouts, mobile first, whilst Dreamweaver handles all the flexible calculations in the background. Let’s take a look..

Let me start off by letting you in on a little secret; I just love disruption. I love it when something new comes along which challenges everything we thought was true, ties it up in a little ball and kicks it out to the curb. This is one of those times and I love it. I just love it.

The disruption was “Responsive Web Design” and “Mobile First” which were first presented to an unsuspecting web industry in 2010. Think about it, the concepts of Mobile First and Responsive Design really weren’t solidly on your radar until a year or so ago.  Then, disruption happened.  

Before I get into the new features of Dreamweaver CS6 which respond to those two concepts, I think it’s important we understand what happened and how this disruption lead to this tutorial series.


Epiphany

It all started for me about two years ago. I was speaking at an Adobe Education Leaders event at Adobe HQ in San Jose and was talking about how educators had to wake up and start actively moving what I then called “Multiscreen” design and development into their classrooms.  


It all started for me in a Beijing taxi

My epiphany around this had occurred in November 2009 in, of all places, the rear seat of a taxi careening through Beijing. When I got into the cab a screen on the back of the front seat lit up and I could interact with the content on it. In many respects it was nothing more than a tablet bolted into the seat with the content fed wirelessly into the device. That is the moment when I truly realized the power of mobile devices, because my first reaction was: “This is the sort of stuff my students create.”


Mobile First

Around the same time I was rattling around Beijing, in November 2009, Luke Wroblewski was musing on his blog about developing a mobile first strategy when it came to web design. A few months later his musing really exploded on the scene when his Mobile First presentation was posted to Linked IN Tech Talks in May of 2010.This video link was quickly handed around the community with a “You gotta check this out.” The premise was simple: Forget about desktop, people. Design the mobile version of the site first, then start thinking about the desktop.


Luke Wroblewski started Mobile First on his blog

This flipped the entire web design process upside down, turned it inside out and rearranged its molecules. Here’s the thing: It made sense.

When designing for mobile the common best practice was to create a mobile version of the site to ensure consistency of the experience. This design was usually a compact version of the desktop site. If Flash was involved it also meant numerous versions of the project targeted at a variety of Flash Light players and devices. One trip to the now-abandoned Device Central was enough to convince me that this was not a great way to do things. The whole mobile workflow was so convoluted and complex I couldn’t help but think what we were trying to do was use a hammer in a situation where a screw driver was the best approach. My most common question when dealing with this was to exclaim: There has got to be a better way of doing this.

As it turns out, there was.


Responsive Web Design

In May of 2010, Ethan Marcotte published a rather interesting article on Alistapart. Entitled Responsive Design, the premise was, again, rather simple: content should adapt to the media displaying it, rather than the other way around.

This idea also made sense and is still resonating to this day.


Ethan Marcotte kicked things off at AListApart

Things really kicked into high gear in 2011. Both Ethan and Luke are successfully making their cases, HTML 5 is gaining traction in the industry and then, the earthquake. A couple of weeks after its annual user Conference, Adobe Max, Adobe dropped its bombshell.  They announce that Adobe is bailing out of mobile development on the Flash platform. To put this announcement in context consider this: The 2010 Max conference had such a heavy emphasis on Flash mobile they were freely handing out Flash-enabled Blackberries, Droids and Google TV to the attendees.

I didn’t find it all that surprising that Adobe was backing out, but the industry’s reaction ranged from “the world is ending” to “never used it anyway, so what’s the big deal”. What Adobe didn’t do was kill Flash because Apple hated it. It killed Flash in the mobile space because, they too had realized: There has got to be a better way of doing this, and both Luke and Ethan were showing how.


Even Adobe is "getting religion".

What really caught my attention was that Adobe made it very clear, after the rubble stopped bouncing, it was moving over to HTML 5 or, as they were now calling it, The Expressive Web big time. Edge, introduced in August 2011 is one response. Adobe’s new-found love for HTML is evident with a new site that is one great big HTML bear hug and Dreamweaver CS6, which hit the streets earlier this year, is also starting the migration in that direction.


Dreamweaver CS6

One of the really nifty additions to Dreamweaver CS6 is Fluid Grids, which, in a way, simultaneously use Ethan’s and Luke’s approaches to designing web pages. If you are just starting to explore the concepts of Mobile First and Responsive Design then a great place to start is Fluid Grid Layouts because, as a visual editor, Dreamweaver lets you see what you are doing and how changes to the CSS ripple from a smartphone, across a tablet and land on the desktop.

When I first started digging into this new feature I honestly felt Fluid Grid Layouts were a hidden gem. After spending some time wrapping my head around them I dialed back that enthusiasm. I couldn’t help but feel this is a work in progress. It was more like a really good first attempt rather than a solid addition to the lineup and I suspect that it will be one Dreamweaver CS6 feature that is regularly updated through the Creative Cloud.

Dreamweaver lets you see what you are doing and how changes to the CSS ripple from a smartphone, across a tablet and land on the desktop

The Fluid Grid layouts are clearly based on Ethan Marcotte’s Responsive Web Design (the book and the article that led to the book). This feature allows you to specify three fluid grids: one each for mobile, tablet, and desktop layouts. Each grid can have 2–24 columns; a common gutter width between the columns and you can specify how wide the grid should spread across each screen.

You then add fluid grid layout div elements to construct your page in the mobile layout. (Mobile First)  The next step lands squarely in the category of “brilliant”—you can resize the elements in each of the layouts, snap them to the grid, and then easily move individual elements to sit alongside and play nice with each other. This is done in either Design view or Live view, and, best of all all, Dreamweaver automatically calculates the percentage width of elements and margins to four decimal places.

This calculation is based on Ethan’s formula of target/context = result. A good example of this would be column width. Let’s assume you have a page width of 1232 pixels and you decide each column should be 350 pixels wide. To get the fluid column width you divide 350 (the Target) by 1232 (the Context) = 0.28409091. You would then move the decimal two places to the right for a result of 28.409091. Dreamweaver’s Fluid Grid layout calculation will shave off the final two numbers for a result of 28.4090 per cent. This calculation applies to anything that has “hard” numbers attached to it such as font size, margin, padding and so on.

The CSS created by the Fluid Grid Layouts uses percentage widths and floats, so it produces layouts that adapt to any screen size. These styles are constructed on the basis of “mobile first” and even work in browsers that don’t understand media queries. For those of you new to Responsive Web Design, this one feature alone is enough to get you into the game.


Caveats

Being a work in progress there are, naturally, “issues”.

For example, Dreamweaver doesn’t have an immediately evident way of showing you which media query controls a particular style rule. You can figure it out quite quickly, but this is a bit frustrating at first. Another is one that a few Dreamweaver users have pointed out: The feature doesn’t support nesting elements to create more complex layouts. Other missing features include the inability to use classes instead of ID’s and it would be rather nice to use semantic elements like header or footer.

There are also a few “gotcha’s” in the process that will bite the unwary and a couple of the assumptions made about mobile screen width are a bit wide of the mark. I’ll deal with many of these over the course of this series.

Still, Dreamweaver’s Fluid Grid Layouts should appeal to those of you starting to get into the RWD game.


Watch Screencast

Alternatively, Download the video, or subscribe to Webdesigntuts+ screencasts via iTunes or YouTube!

Series NavigationLaying Out Fluid Grids in Dreamweaver CS6 >>

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Hamid

    thx for the article and btw i highty recommending ppl to taking a look at lynda.com DW CS6 tut videos

    1. http://www.lynda.com/Dreamweaver-tutorials/Dreamweaver-CS6-New-Features/97612-2.html
    2. http://www.lynda.com/Dreamweaver-tutorials/Dreamweaver-CS6-Essential-Training/97613-2.html

    thx for this nice article.

  • mohamed

    Enjoyed the article.
    Waiting for next one!

  • BT

    Let me know if I’m just not up to par with what Dreamweaver can accomplish, but a good bit of who I work with (and myself from the little bit of Dreamweaver I use) abhor the use of Dreamweaver for the garbage html and css it outputs. Has that improved recently? I am all for responsive web design and making it as easy as possible to implement, but not at the expense of making something difficult for my fellow designers and programmers to interact with on a code level…

    Now, please don’t mistaken this for a diss on the article. I understand the importance of looking at all the tools we have available as designers and choose which ones work best for our particular goals. This question merely reflects my own interests as a code-based web designer.

    • http://www.stacigh.com Stacey

      I inspected the code from this tutorial and I have to say that it’s bloated–not because of the author but because of Dreamweaver. Even though the generated code is fairly small and simple, it’s still repeated for each instance of #header, #main, #footer and #side (the only difference for this is that the margin-left is a different percentage). It’s also bad practice to style objects using ID’s. ID’s really should be reserved for Javascript programming and classes should be reserved for styling objects. That being said, newer developers should look into OOCSS and avoid using DW code generation when possible.

      • CodeMunk3y

        What’s the issue with using ID’s for styling?

        ID’s should be attached to DOM nodes according to what is semantically correct. ie. when there is one and only one on the page. If you need to style it later, then there shouldn’t be an issue.

        • http://www.stacigh.com Stacey

          While technically you CAN style something using an ID, it doesn’t mean that it’s always the best practice. For instance, let’s say you want to add a class or style to an element using JS. If you set a style on the ID that conflicts with an added class, the style on the ID gets higher priority over a class, effectively rendering your added class useless. While you technically can just insert a style, it’s typically a better practice to define any styles you want to add in your stylesheet and then call them with a class.

          So if you’re not using JS or planning to use JS at some point in your career, don’t worry about it.

          • http://lukewhitehouse.co.uk Luke Whitehouse

            But why is it considered bad practice?

            The way I see it, id’s should be used when there is only one of that item on a page whereas classes should be used if there are multiple. I do actually use classes 99% of the time however I don’t actually understand why this would be bad practice.

            The fact that id’s have a larger value than classes and normal tags is how the system has been designed. Whats wrong with it?

          • http://www.stacigh.com Stacey

            Thanks for asking. I actually put together this quick bit of code to illustrate my point:

            http://jsfiddle.net/stacigh/4nZcB/3/

            To make myself a little clearer, I’m not promoting the non-use of ID’s to target unique elements. Just the opposite. What I am promoting, however, is not using CSS to apply style directly to those elements. Instead, you should give the element a class that you can style. Why would you want to do this? Let’s say that you want to add a class that’s going to change some properties of the object that you will be targeting with CSS. For example, the background color. You apply the background color to a box, styling it with the ID. But later, when you manipulate that object using JS/jQ, you want to add a class to that object that just happens to change the background color.

            But it doesn’t work. Well, why not? It’s because you used an ID to apply styles, which take a higher priority over a class. So when you add the class to the same object, it still thinks the background color that was defined in the ID is more important than the background color that was defined with the class. And then you get into things like adding !important to your declaration–which can get messy. Or worse! You decide you want to go back and fix it but every line of code you edit ends up causing 2 more bugs. Before you know it, you have a Hydra on your hands.

            There are other things that can happen when you get into MVC frameworks as well, since you would be using partial views to generate blocks of redundant code. If you break the “styling with ID’s” habit, you avoid tons of issues there as well.

          • FROweb

            good point!

          • http://www.facebook.com/people/Jim-Dawkins/100002207329301 Jim Dawkins

            I get your point about classes but I disagree that you shouldn’t style using an ID. Styling an element with an ID is fine as long as that element is unique. Classes are meant to be usable on multiple elements. If your page has one element on it called id=”rotator” there is no need to style it with a class. Just use the ID. If you worry about spaghetti code why wouldn’t you worry about spaghetti CSS.

  • Jesus Bejarano

    Errrr…people still cares for DW?. Learn sublime text or coda for god`s sake. `_´

    • Itachi

      My opinion is that DW can’t match Sublimetext or Coda in workflow and speed. DW is so “heavy” piece of software for pc. Is slow and big. I have worked in DW for 1,5 year than I installed sublime text and I will never go in DW again.

      All this is only my opinion so pls don’t take this like ofense or something like that thx.

      Sorry my english.

  • Pingback: Getting Started With Dreamweaver CS6 Fluid Grids | Webdesigntuts+ | Dreamweaver | Adobe-Tutorial.com

  • http://theultrasoft.com Suku

    I’m not new to DW but sill got some real and Important Information about this. Thanks buddy!!!

  • Tom
    Author

    Interesting comments. Though all of the concerns expressed are valid, I made it pretty clear the series was aimed at people looking for a way of getting into RWD. I did point out there are some issues and concerns regarding this Dreamweaver feature and that I honestly felt it was a “work in progress”. I also did the series because there is a lot of stuff out there that tends to put it into the realm “isn’t this easy to do”? It isn’t and I felt it important to show people the minefield they are walking into.

    Still the Fluid Grid Layouts are a great way for someone to understand the Mobile First and RWD concepts and how a change in one area ripples through the entire project.

    Thanks for the comments. They are great and keep them coming.

  • Dane Henas

    I’ve been toying around with CS6. Is there any way to adjust the margin % after the page is created? Also is there any way to have a fixed width of say 960 pixels for just the desktop site, or is that old thinking??

    • http://lukewhitehouse.co.uk Luke Whitehouse

      If you are wanting to set actual pixel based widths then that would be considered an Adaptive Design.

      The difference being between Adaptive and Responsive Web Design is that Adaptive uses a static layout (width = 960px, font-size = 28px etc) whereas a responsive uses a Fluid layout (width = 85%, font-size = 1.75em etc), then they both use Media Queries for breakpoints (meaning when you get to a device at or smaller than 320px then the site might fold into a 1 column design).

  • Dane Henas

    Thanks. I just don’t like stretchy websites on desktop computers–I tried putting in a set width of 960 pixels in the media query for desktop and it seems to work unless you try to make the window smaller, which is cool.

    What about adjusting the margins between columns from say, 15% up to 25% after you’ve created the page? Is there away to do that? Is that in a style sheet somewhere?

    • Dane Henas

      Can you add Editable Regions to a fluid site?

  • Pingback: Why Styling an Element with the ID Selector is a Bad Idea @ stacigh studios

  • Joseph

    I appreciate the post, well written. Used to use DW years ago. Tried the Coda demo and never went back.

  • Bryan

    IDs are not evil by any means. However, as Stacy showed in her example, CSS specificity can create issues when mixing IDs and class names when it comes to styling your HTML.

    Also keep in mind that it’s possible to use a descendant selector or important keyword in many cases to fix these situations. That isn’t necessarily the best solution. But for one-off situations it’s possible to get around.

    A good rule of thumb would be to use class names for CSS styling and IDs for unique identifiers that allow JavaScript to select your HTML elements. If you aren’t planning on using JavaScript on an element, you don’t need the ID and can use a class name. Then you can always add an ID to the element later if you need to select it with JavaScript. This works because your CSS isn’t styling IDs… just class names. On top of that, if you need to change how an element is styled using JavaScript, it’s considered good practice to simply add/remove/change the class name instead of using inline styles.

  • http://www.pukwa.com Chris

    Thank you VERY much for this series of very clear and to the point videos. You have an uncanny way of presenting what could be a complicated process in an interesting, logical way which is easy to understand and follow. Again – Thank You!

  • Pingback: Has Adobe Gotten its Mojo Back? | Webdesigntuts+

  • Pingback: My Stream | Has Adobe Gotten its Mojo Back? | My Stream

  • Meron

    Just starting out with Fluid Grid Layouts. Many thanks for this well thought out, knowledgeable tutorial. And I’m on to the next…

  • Angoves Student

    I would like it better if it could make me sammich

  • Angoves Other Student

    You left out the a for a sammich or the es for make me sammiches.

  • PaulaArtist

    Thanks, I watched your 3 videos on using fluid grids and found them extremely clear and useful. The one thing I am still trying to figure out is how to make a div “hide” in mobile layout. Keep up the very good work and I will certainly recommend you to other DW users.

  • holidaytrout

    Hi, Thanks Tom for the article and everyone for the comments. I’m new to RWD and this is very helpful. I have a basic question: After one makes a page with, for example, 9 columns for the desktop, is it possible afterwards to update that to say 10 or 12 columns?

    Many thanks.

  • Pingback: Responsive web design with Dreamweaver CS6 fluid grids & templates | Paula O'Brien

  • http://www.facebook.com/people/Jim-Dawkins/100002207329301 Jim Dawkins

    flex, stretch, fluid designs are not new. its understandable with phones , tablets etc why the concept is becoming more popular again. With that said, fluid designs are a pain to manage, especially if you are dealing with ever changing content or updates on your website. I’d still rather work with fixed width. Most good fix width designs will work fine on a PC or tablet. Then you have an alternate style for mobile and even with that, its probably only needed for specific content like a search page. Many new phones have full fledged capable browsers.

  • Pingback: Responsive Design on Dreamweaver CS6 | Freddy's Uni Blog