styling individual side blocks

styling individual side blocks

by Shabana Akhtar -
Number of replies: 4
Hi,

Is there any place in the css files where I can define seperate properties for each side block. For example different colour headers for latest news, calendar etc.

I have had a look at some themes but have yet to come across a moodle theme which does this.

Any help would be greatly appreciated.

Thanks
Average of ratings: -
In reply to Shabana Akhtar

Re: styling individual side blocks

by Frank Ralf -
Hi Shabana,

Most of the blocks do have their own class or id attribute which you can use as CSS selectors. For example the following code will give the header of the news block a new background color (see screenshot).

.block_news_items h2 {
background-color: lime !important;
}

You can either use your browser's "View source" option to analyse the code or better use Firebug Development:Firebug.

For further information see Themes FAQ and CSS FAQ.

hth
Frank
Attachment Styling_news_block_header.png
In reply to Frank Ralf

Re: styling individual side blocks

by Shabana Akhtar -

Hi Frank,

Thanks for reply it got me going on the right track. i am just starting out trying to create a theme for moodle so was working my way round the code.

Shabana

In reply to Shabana Akhtar

Re: styling individual side blocks

by Dan Locke-Wheaton -

Hi Frank,

Having stumbled across your email I think I may have found the answer to a problem I have been trying to solve for ages.

Please for a beginner like me can you explain where you can find these block ID or individual  CSS sections like your news block.

Thanks

Dan

In reply to Dan Locke-Wheaton

Re: styling individual side blocks

by Frank Ralf -
Hi Dan,

use Firebug when using Firefox or one of the alternatives for other browsers mentioned there. You could also use your browser's "View source" option but Firebug is much more comfortable.

You might also have a look at Themes FAQ and CSS FAQ for more information.

Cheers,
Frank
Attachment Moodle_Demo_Firebug128.png