Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedSorry, 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.
Comment #2
Nigel CunninghamIt 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.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedOH you want the canvas centered? That's totally different.
Comment #4
Nigel CunninghamOh! Cool! So then I remove the margin regions I've made and make the canvas fixed width, right?
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedYeah. Centering a fixed width canvas was something I had intended to do and forgot to implement.
Comment #6
Nigel CunninghamAdjusting the 'closed' status so people who look for this in future won't think from the status that it's impossible.
Thanks!
Comment #7
Rodger_G CreditAttribution: Rodger_G commentedDear 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
Comment #8
Rodger_G CreditAttribution: Rodger_G commentedDear 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