Hi,

I'm using Drupal since a week now, and i'm still learning a lot of stuff. The example page tutorial helped me a lot, but there's one thing i'm struggling with the past few days. I'm sure it's very simple for you guys, but i'm hoping you could help me out.

I'm trying to centre the content of the 'Home Area 2' block. I know i need to be in the style.css, but i tried a lot of methods i found online, but it just won't work. Any help would be greatly appreciated. Thanks in advance!

Chris

Home Area 2

Comments

gtsopour’s picture

Assigned: Unassigned » gtsopour
Issue tags: +Bluemasters theme, +bluemasters
gtsopour’s picture

Assigned: gtsopour » Unassigned
Issue tags: -Bluemasters theme, -bluemasters

Hello Chris,

I think that with the following code, you will accomplish what you want. Just place it at the bottom of your style.css file* sites/all/themes/bluemasters

.region-home-area-2 .block .content { text-align:center; }

Override style.css with local stylesheet

*Since you are new to Drupal, I would like to inform you about the right way to add css rules. This brief guide will demonstrate how to setup Bluemasters theme to support a local.css file where custom CSS rules and modifications could be placed. Yes, you can add directly to your style.css file extra rules, but following the practise with local.css, there is no worry if the next theme update will override all your custom changes.

This can be done in 3 simple steps:

  1. Create an empty .css file under the /sites/all/themes/bluemasters path and name it as you wish. local.css is always a good choice.
  2. Edit the bluemasters.info file and add a line like stylesheets[all][] = local.css after stylesheets[all][] = style.css
  3. Clear all cached data.
    This step is important in order to force your template to be informed for the changes you have made in the template files. To do this go to Administer » Site configuration » Performance » Clear cached data

Finally, your bluemasters.info file will contain the following code

name = Blue Masters
description = Theme based on Blue Masters PSD template
version = VERSION
core = 7.x
engine = phptemplate

regions[header] = Header
regions[search_area] = Search area
regions[highlighted] = Highlighted
regions[content] = Content
regions[sidebar_first] = Sidebar First
regions[banner] = Banner
regions[home_area_1] = Home area 1
regions[home_area_2] = Home area 2
regions[home_area_3] = Home area 3
regions[home_area_3_b] = Home area 3 b
regions[footer_left_1] = Footer left 1
regions[footer_left_2] = Footer left 2
regions[footer_center] = Footer center
regions[footer_right] = Footer right
regions[footer] = Footer
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom

stylesheets[all][] = style.css
stylesheets[all][] = local.css

project = "bluemasters"

Now, you can edit the local.css file and add your style rules.

.region-home-area-2 .block .content { text-align:center; }

Thanks
/George

gtsopour’s picture

gtsopour’s picture

Assigned: Unassigned » gtsopour
chrishgk’s picture

Unfortunatly the centre script didn't make any changes. I forgot to mention the block i'm trying to centre is a module (Agenda). I asked this question at their board first, but they told me i had to change the style.css of my theme. Maybe my agenda module is still overriding the style.css theme from blue masters?

EnriquePhoenix’s picture

Thanks for the info. I started editing my style.css not thinking of the possibly of losing all my changes in the future.

djsagar’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

It's working fine

Thanks.

gaurav.kapoor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.