What's the CSS to change the color of the section which contains logotype?

What's the CSS to change the color of the section which contains logotype?

by Christopher Poon -
Number of replies: 3

Hello,

I am trying to change the color from the default white to a color of my choosing, however I am not sure how to do it because there is no option to do so in the "Essential" theme colour settings. The website is http://www.online.englishedukation.com

Any advice is greatly appreciated, Thanks.

Average of ratings: -
In reply to Christopher Poon

Re: What's the CSS to change the color of the section which contains logotype?

by Rodney Wolford -

Which white are you talking about? The background or the slider area or both? Each are easily changed in the Theme settings.

1. Go to /site administration / Appearance / themes / Essential / Colour Settings page. Here you can upload a background image that will be tiled on all pages. This could be a color swatch, for example.

2. The theme's slider settings can be set at /site administration / Appearance / themes / Essential / Frontpage Slideshow. Background colour is the the first option.

3. Finally, you can also make custom changes to background and other elements by going to /site administration / Appearance / themes / Essential / General Settings. At the bottom of this page is an area for Custom CSS. With only a small amount of effort, you can identify the CSS used to generate your background and then change it by adding the correct code attributes in this area. 

First step is to "Inspect the Elements" to see what code is setting the background color. If you are using Firefox, just right click on your screen and select "Inspect Elements."

This will open a second window that contains all the code used for your page. Now, when you move about in  the Inspector Window, parts of your Moodle screen will have begin to be highlighted.

When the area that contains the background is highlighted, you can see what code elements are being used. You can also change the values in the inspector to see how the page changes. If you do that, I think you will come to the following settings.

body {
    border-top: 3px solid #990C00;
    background: url('') repeat scroll 0% 0% rgba(255, 255, 255, 1);
    font-size: 13px;
    font-weight: 400;
}

In the inspector, just change the rgba value until you have the color you want. (This is a non-destructive process. As soon as you close the inspector or refresh the page, any change you made goes away. ) When you have a color that you want, just copy the code and paste it into the custom CSS settings box in the theme.

It's also a great way to learn how Moodle is doing its magic.

Hope this helps.

Rod

In reply to Christopher Poon

Re: What's the CSS to change the color of the section which contains logotype?

by Lil Douglas -

Hi there Christopher,

I'm not certain but think I've just encountered the same problem as you. Behind where the logo goes is a diagonally striped background that I wasn't happy with. I've found a workaround that, although isn't perfect, will suit me for the time being until I can figure out what lines in the CSS files to edit!


Go to administration > appearance > additional HTML and add the following code:

<style type="text/css">
#page-header { background:none; }
</style>


Once you've done that, upload a jpg colour swatch as your background image. 


Good luck smile

In reply to Lil Douglas

Re: What's the CSS to change the color of the section which contains logotype?

by Mary Evans -

Sorry to say that is not the correct way to do this.

There is a custom CSS box in the Essential theme that allows you to add CSS directly into the theme.