Themes

 
 
Picture of Chris Webb
centering .headermain in the serenity theme
 

Hi all,

I am trying to modify the serenity theme in Moodle 2.4 and I can't seem to centre the main header that has the name of the site.

I have tried text-align but it doesn't move. I can change the weight and font so I Know I have the right selector. Does anyone have any ideas. I should add that I am fairly new to this but understand basic CSS.

This is what I have in there right now.

.headermain {
    font-weight: normal;
    margin: 1em 1em .75em;
    text-align: center;   
}

Thanks,

 

Chris

 

 
Average of ratings: -
It's only an avatar...
Re: centering .headermain in the serenity theme
Group DevelopersGroup Documentation writersGroup Particularly helpful MoodlersGroup Testers

Try adding h1 directly in front of .headermain like so...

h1.headermain {
    font-weight: normal;
    margin: 1em 1em .75em;
    text-align: center;   
}

Should fix it.

If it does not move then try this ...
h1.headermain {
    font-weight: normal;
    margin: 1em auto .75em;
    text-align: center; 
    width: 90%;  
}

Cheers

Mary

 
Average of ratings: -
Picture of Chris Webb
Re: centering .headermain in the serenity theme
 

Thanks for your help. The second option worked.

 
Average of ratings: -