Confused on how to use the 1140 grid

I am working on a new project for a client and want to try responsive web design. I am researching the 1140 grid by Andy Taylor but am completely confused as to how to use it. I have the prototype built in FW but don’t know where to go from there. The HTML and CSS has me baffled. I have seen other grids and like this one better because of the math. I know many gurus here don’t like grids but I want to learn how to use one or figure out on my own how to make this current site responsive. The total width of the site is 1140px so that is my starting point. From there I can’t figure out all the rest and I can’t find a useful tutorial on how to use it. Help? Suggestions?

Yes, it can be harder to learn how a grid works than to learn CSS. :slight_smile: Because you are thinking in terms of px widths, you are probably in the wrong head space to start with … because the real idea of a responsive design is that it doesn’t have a fixed width but can scale to different browser sizes. It would be good to consider first what you want the site to look like at various widths … such as half the width of that image you posted. What will the elements do? Where will they sit? This may prompt you to rethink the layout, as that design looks more suited to a fixed width design, to be honest.

An alternative is to have a fixed width design, and then at some point (say on a small screen like that of a smart phone) determine a different layout via media queries. A few decisions like this need to be made first—whether you use a grid or code this yourself. Personally, I wouldn’t touch a grid—not because I’m being snooty, but because I truly think it’s a lot messier and harder to do than to code from scratch.

Thanks, Ralph. I see what you are saying. This layout would be better as a fixed width design. I can remove some of the elements for smaller screens, like the backgrounds for the 3 columns and the large main background. This is also going into WP as soon as I get it all coded in HTML and CSS. That will be another challenge as I am not used to designing for WP. I will go ahead and code this up for laptop/PC and come back here if I need help along the way. :wink:

Cool, no worries. Looking at it again, it may not be hard to make that layout responsive. If the three middle columns are floated, on a small screen you could just remove the floats. Likewise with the footer elements. I’m not sure what the WebTrak section at the top is for, but that may be a little harder to deal with if it’s a big image or video.

WebTrak is supposed to be embedded but at this time I am not sure I can do it. It is an app for local airports. This site is for the counsel set up for noise control. The client wanted to use the embedded app and if it doesn’t work then I would use an image slider. That can be removed for smaller screens as well although I think that image sliders can be resized for smaller screens.

So then I will go back to using percentages instead of px. I have read through Responsive Web Design but that is based on a 960 grid. Mine will be wider for the full sized site.

Hm, both of those could be tricky, depending on their nature … but it may be fine. A full-width slider will often show up fine in a smart phone, but it will just be a lot smaller (to fit into the viewport).

It could be worth considering making that section much narrower and having something beside it (like text) that can easily drop below on a smaller screen.

I don’t think the client will go for that. I will check on it. Just to make sure that this old brain is getting this right, my page wrapper will be 100% and then I need to figure percentages for all the components with the wrapper, correct?

You could do that. But probably a nicer option is to set a width something like 95% BUT also set a max-width (say in px or em—such as 60em—and perhaps min-width). That way, the site doesn’t become too wide. It’s not much fun reading lines of text that start to get really long … such as on this site if you expand your browser on a really wide screen.

Ok that makes sense. I also forgot how to do the inner backgrounds. I have main content wrapper and then the left content wrapper, middle content wrapper and right content wrapper. I have sliced the backgrounds and need them to be able to expand as more text is added. I am really losing my mind. I read a lot but need to create more sites just for fun in between projects to stay on top of things.

Hm, yeah, that’s where you need to choose a background design that can repeat endlessly.

Well for the content container I sliced it into 3 pieces, top, middle, and bottom. That way it can expand. I think I have an old design that does the same thing. I just need to find it to see how I coded this in the past.

I never really slice anything for the web. If you are talking about the big map background, there’s no need to slice it. You can place it as a background on the <body> element.

Its the main content area that has the 3 columns. There is a background image for containing the whole area and then background images for the 3 columns. I do have the background map image already set in the body element or actuall the main wrapper element. Should I switch it to body? It is 1140px wide.

It should be OK in the wrapper itself. But what are the images you are slicing? If it’s the white lines, I’d suggest you just use a border with border-radius, which si supported in all modern browsers. (Old browsers would just get square corners, but meh …)

Then I will do that for the inner 3 columns but what about the outer background for the main content container? That is an image that is transparent with rounded corners and needs to expand as more text is added.

Again, I’d do the same for that. Give it a thin white border, CSS3 rounded corners, and an rgba background color that makes it semi-transparent. An alternative would be to put a semi-transparent repeating image if you need it to work in older browsers (though I’m happy to leave them with what they can handle).

Will these CSS3 elements expand with the addition of more text? Remember this is for WP and as the client creates more posts, the background will have to expand. I was also playing with the percentages last night and it wasn’t looking too good. I may have to rethink this…not the design, the client wants that design, but the fixed vs fluid. I can create CSS @media calls for screens at different sizes then get rid of certain graphic elements at each screen size. So for instance this starting one could be for screen sizes 1140 and up. Then I could shrink the background a bit and cover the tried and true 960 up to 1140, and so on. Might be more work but that saves me having to convince the client that after SEVERAL prototypes, this one still isn’t going to work for going mobile. I think using pxs will still work with this setup. I will have to experiment.

Yes indeed.

I’m not sure you need to change the background images at all, though. At a certain width, you can just change those side-by-side elements to float: none, so that they sit on top of each other. The background image can stay just like it is.

Nice! That sounds like the way to go. Could you give me a snippet of code so that I know what I am doing to get the backgrounds correct? You don’t have to worry about color, I deal with that. Also where would these elements be in the HTML code? I have left_content, middle_content, and right_content. I may rename those to left_sidebar, main_content, and right_sidebar.

Sure, but I’m not entirely sure which backgrounds you mean. I only really see one large background image … the map that sits behind the content, with a control tower image at the top. That’s entirely independent from the three center boxes.

So the first thing I’d do is probably set up the <body> element. Place that bg image on the background:

body {background: url(bgimage.jpg) no-repeat 50% 0;}

Then I’d set up a wrapper, set to your preferred width, and center it:


.wrapper {width: 1140px; margin: 0 auto;}

Then place the main heading inside that (an <h1>, if you like), the a <ul> for the menu, with the menu items set to float: left;

Then the WebTrak element (a div?), and the main content div. (You can add in rounded corners later).

Set the main content div to overflow: hidden, and add in the three inner divs, each set to float: left; and with an appropriate width. Perhaps set some padding on the main content div (e.g. padding: 50px 20px 40px;), and then give each div the desired width, and give the middle div a left and right margin to create the space between the divs. You can also give each inner div a white, 1px border. Remember that this border adds to the overall width, so subtract that from the widths of the inner divs. If you’ve given the container 20px padding left and right, that means you have 1100px width left to play with. Remove another 6px from that for the borders. So your three inner divs have to share 1094px between them, with some space in between them, too (40px on each side of the middle div?)

That’s a basic way to set this up, but it is all fixed width at this stage. You could do all these widths in % instead, but you have to be careful when the borders come into play. They are better off being placed on extra divs inside the three floated divs. With % widths, though, you may get some rounding errors, as each browser will translate % to pixels differently, and if you’re not careful, one of the floated boxes will end up dropping.

Sorry, that’s all a bit garbled. See if you can make anything of it all, and perhaps show us your results. We can fine tune this as you go. :slight_smile: