Top Margin problem

Top Margin problem

by John C. -
Number of replies: 3

Greetings everyone.

I recently created a new theme from the formal_white theme, and since I've converted it to be compatible with Moodle 1.6, I can't seem to remove the white border/margin around the header of the screen: http://moodle.tmsstage.com/

I've looked at every style, and have tried adding simple HTML into the body (topmargin=o, leftmargin=0) but nothing seems to remedy the problem.

Does anyone know what is causing this?

Thank you!

Average of ratings: -
In reply to John C.

Re: Top Margin problem

by Patrick Malley -
I kinda like it. smile

My guess is that this value (found in meadows/fw_fonts.css) is creating the margin and, as such, should be deleted:

body {
margin : 5px;
}

This should get rid of the 5px margin you don't like.
Average of ratings: Useful (1)
In reply to John C.

Re: Top Margin problem

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi John,

There are several things you could try. But first of all I notice that in your theme's header.html file there is this:

<body topmargin="0" leftmargin="0" etc.

These attributes are totally deprecated and should not be used. You could instead use:

<body style="margin-left:0px; margin-top:0px;"

Or, in one of your theme's CSS files you could check where body is defined and put:

body  {
  margin-left:0px; 
  margin-top:0px;
}

Also, in your theme's header you are using the <hr> tag, which is not needed since you have a logo.

See attached screen shots.

Hope that helps,

Joseph

Attachment image-0000.jpg
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Top Margin problem

by John C. -

Thank you both so much! I can't believe it was such a simple tweak - as I'd seriously gone through every other style and couldn't get it to work.

 

Thank you both.

John