Create my own theme css modification

Create my own theme css modification

by Nutan Rajmlani -
Number of replies: 16

Hi,

everyone is there anyone who tell me how to remove gaps between different blocks and how to put image or highlight on the menu which come upside default eg. home etc and also on the available course and want to edit available course.

Please is there anyone who help me.

Thanks

Nutan

Average of ratings: -
In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

When you say 'remove gaps between different blocks' what exactly do you mean?

At this moment in time there is no way you can add an image in the menu.

Mary

In reply to Mary Evans

Re: Create my own theme css modification

by Nutan Rajmlani -

Hello,

I posted image in previous post, remove gaps means the space between two block for example navigation and settings block there is some space between them, so i would like to display it as one block only.

Thanks,

Nutan

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

First you need to remove the margin & padding from the block so use...

.block { margin: 0; padding: 0;}

this will make them all fit together

To add a color to the background in the page add...

#page-content { background-color: #eee;} /* left-side */

#region-post-box { background-color: #ffe;} /* right-side */

If this is not what you want get beack to me and I'll give you another idea how to fix this. 

In reply to Mary Evans

Re: Create my own theme css modification

by Nutan Rajmlani -

Hello,

Thnaks for your reply but it is not working.

still there is gap between the blocks. Please help me out.

Thanks,

Nutan

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

This is getting rediculous. First you ask for help. Richard answers and tells you

.block { margin-top: 0; margin-bottom: 0;}

and you say this did not work.

So I suggested .block { margin: 0; padding: 0;}

and this still did not work.

In that case can I have a link to your website?

and also, can you upload your CSS file here.

Thanks

Mary

In reply to Mary Evans

Re: Create my own theme css modification

by Nutan Rajmlani -

Hello,

Are you getting angry? It was my mistake i not put the css code at right place.

Now it is working fine. Thanks a lot for ur help and sorry for the trouble.

Thanks,

Nutan.

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

No not angry, just frustrated that nothing seemed to be working.

But now I am pleased to hear you got this right eventually. Cheers!

In reply to Mary Evans

Re: Create my own theme css modification

by Nutan Rajmlani -

Thanks Mary for your help.

You really have a helping nature smile  and u believe in knowledge sharing smile.

Thanks,

Nutan

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Have you tried the links and documents Mary  has highlighted in the forum introduction?

Where to find more help:

Development: Themes 2.0 is a good starting point also Themes FAQ and Development: CSS FAQ and not forgetting Development: Firebug. You may also find Development: Themes 2.0 How to use images within your theme and Theme settings useful resources where you can find out all about the different options in Moodle Themes including the Custom Menu!.

Richard

In reply to Richard Oelmann

Re: Create my own theme css modification

by Nutan Rajmlani -

Hi,

Removing gaps means in the left or right side there are different blocks for eg. main , navigation , site administration etc. so there is some spaces between these blocks. I want to remove this gaps so it can like no spaces between them.

 

like in this image there is gap between navigation and settings. I dnt want this gap. and also want to change the bullet symbol and want contents in center.

and want some background images on this menu.

Please Please help me.

Thanks

Nutan

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Nutan Rajmlani -

Hi,

Is there anyone who can help me to remove space between blocks as shown in the image given above.

Thanks,

Nutan

In reply to Nutan Rajmlani

Re: Create my own theme css modification

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Check using firebug (FF) or similar in IE/Chrome - you'll need to reduce the top and bottom margins for the blocks, something like the code below. Firebug will tell you if there is already a rule in your current theme to edit, and if it's coming from a parent theme you can add it to the end of your css file.

.block {
    margin-bottom0;
    margin-top0;
}
In reply to Richard Oelmann

Re: Create my own theme css modification

by suman bogati -

If you are running standard theme on your moodle site then just open 'blocks.css' of 'base' theme on any text-editor software.

At very first line, there you will get the line
.block {border:1px solid;margin-bottom:1em;}
just replace it with the line
.block {border:1px solid;margin-bottom:0;}

If you are using other theme than standard theme then do as Richard said put that css code at end of your css file.

In reply to suman bogati

Re: Create my own theme css modification

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Just to make this clear, your should NEVER make alterations to BASE theme CSS as this is THE default parent of ALL themes in Moodle.

Thanks

Mary

In reply to Mary Evans

Re: Create my own theme css modification

by suman bogati -

Thanx Marry and Richard for make me correct, I knew the things and now i am wondering how was it happend, and I do apology for it.

Anyway Nutan I took my words back please do as Richard Said and please don't change your css into base theme.

In reply to suman bogati

Re: Create my own theme css modification

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Sorry to contradict Suman

DO NOT edit base theme!!!

Add the line to your own css and it will override the base css for your theme - editing base will affect every theme on your site.

If you have any theme based on a parent (and all the standard Moodle Themes as far as i am aware use base as a parent) you should not edit the css in the parent theme, but override it in your own.

It is also good practice not to edit any of the core moodle themes themselves, but to clone them or use a child theme as changes to core themes will be overwritten any time you upgrade your moodle site and are then harder to track back any changes.

Richard

Edit - came straight from gmail to post and just noticed Mary has posted the same thing smile