Hi.

I'd like to centre a fixed width region in a page. Is there some way to accomplish that which I'm failing to see? Sorry if it's a silly question!

Nigel

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Sorry, not with the flexible layout, at least not from the UI.

I'm trying to think if there's any CSS that could do it; you could center the content of a pane by setting the margins. But I can't think of a way to really do this. :/ Well, it may depend on what's to the left and right of the region, I suppose.

Nigel Cunningham’s picture

It must be possible in general, because there are lots of themes that have centred, fixed width regions. (I just switched from Tapestry, which does that).

Hmm. Would one option be to not completely override the page.tpl.php and do the centering in there? (I just want blank space on either side for users with crazy large screens.

merlinofchaos’s picture

OH you want the canvas centered? That's totally different.

body .canvas-class {
  margin-left: auto;
  margin-right: auto;
}
Nigel Cunningham’s picture

Oh! Cool! So then I remove the margin regions I've made and make the canvas fixed width, right?

merlinofchaos’s picture

Yeah. Centering a fixed width canvas was something I had intended to do and forgot to implement.

Nigel Cunningham’s picture

Status: Closed (won't fix) » Closed (works as designed)

Adjusting the 'closed' status so people who look for this in future won't think from the status that it's impossible.

Thanks!

Rodger_G’s picture

Issue summary: View changes

Dear merlinofchaos (or others!),

Could you please help me understand exactly how to implement your CSS code from post #3? I think this thread, and your solution describes exactly what I'm looking to do. I'm brand new to Drupal, but not to coding - I just don't yet understand what goes where in Drupal.

If it helps to know, I'm running Drupal 7.31, using Panels version 7.x-3.4.

I've been searching for a solution for a few hours, but I have a sense it's simple.
I'll appreciate any advice for this.

Cheers,
Rodger

Rodger_G’s picture

Version: 6.x-3.7 » 7.x-3.1
Assigned: Unassigned » Rodger_G
Status: Closed (works as designed) » Active

Dear merlinofchaos (or others!),

Apologies for multiple posts, this is my first to any Drupal message board.

Could you please help me understand exactly how to implement your CSS code from post #3? I think this thread, and your solution describes exactly what I'm looking to do. I'm brand new to Drupal, but not to coding - I just don't yet understand what goes where in Drupal.

If it helps to know, I'm running Drupal 7.31, using Panels version 7.x-3.4.

I've been searching for a solution for a few hours, but I have a sense it's simple.
I'll appreciate any advice for this.

Cheers,
Rodger