Putting 2 blocks of 8 units in a 16 units region

Please register or log in to post to the forums
4 replies [Last post]
olivier.obuchowski
olivier.obuchowski's picture
Offline
Joined: 2010-04-22
Posts: 1
Putting 2 blocks of 8 units in a 16 units region

Hi,

I have a layout with no sidebars and I want to put 2 views blocks next to each other.
I've set them to 8 units each but it doesn't fit and the second blocks goes to the second line.

I tried to use alpha and omega classes (like in 960 framework) but it doesn't work.

How should I do this? And I would prefer not using panels if possible.

Thanks

jeremy
jeremy's picture
Offline
Joined: 2009-06-09
Posts: 740

If you place two blocks in the same region they automatically resize so they both fit side-by-side so forcing the width of them is a step you shouldn't need to make. Give that a try by adding those blocks in the same region and removing the widths from them so they automatically resize.

bkno
bkno's picture
Offline
Joined: 2010-04-24
Posts: 2

I'm having the same trouble with the starter theme. In a node template's content area I'm specifying two grid columns (grid16-10, grid16-6) and they don't fit in the space. I think this is due to #content-inner-inner having margins set, which is making the content area 940px wide. The result is it's impossible to use the full grid width when laying out blocks in the content area. I'd be interested to hear the reasoning behind this, or find a solution.

Chris
Chris's picture
Offline
Joined: 2009-06-30
Posts: 20

bkno,

We add the left and right margins to the content-inner-inner region because the content region gets a lot of elements that are not blocks (e.g., picture, title, author, links, etc.), and therefore don't otherwise get the margins (which create the grid gutters) that blocks get.

If you'd like, you can target .content-inner-inner to remove the left and right margins when there are no sidebars with the following css in your local.css file:

body.no-sidebars .content-inner-inner {
  margin-left: 0;
  margin-right: 0;
}

When you do that, the two 8-unit wide blocks should fit correctly. Though you'll need to add margins back to any node (non-block) content you choose to display in the content area in order to keep it grid-aligned.

bkno
bkno's picture
Offline
Joined: 2010-04-24
Posts: 2

Thanks Chris, that sounds like a good reason. I like your solution of targeting .content-inner-inner using a specific body class. It's a good way of allowing full grid width usage on a particular node type, without it disrupting regular article pages.

Liking Fusion so far!