HTML block not the same size on Right as Left

HTML block not the same size on Right as Left

by Mary Cooch -
Number of replies: 9
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Could anyone tell me why, on this page, the blocks on the left have more space around the pictures than the blocks on the right? I've made the images the same size and as far as I can tell done all blocks exactly the same -but they don't look the same!
It's here: http://vle.olchs.lancs.sch.uk/
Thanks
Average of ratings: -
In reply to Mary Cooch

Re: HTML block not the same size on Right as Left

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
When I looked in Safari on my mac they were the same size. If you really want to work it out, use the Firebug plugin for Firefox to check that the HTML and CSS is identical.
In reply to Tim Hunt

Re: HTML block not the same size on Right as Left

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Thanks Tim; unfortunately all of my school is on IE where they do look different! I will get the firebug plugin although I'm not sure I'll be able to do anything as I don't have access to the files on the server to change anything like that, and I certainly havent done anything in the blocks themselves - it's an untampered with standard logo theme.
In reply to Mary Cooch

Re: HTML block not the same size on Right as Left

by Mauno Korpelainen -

Left blocks don't obviously know the width of right blocks...and vice versa

http://docs.moodle.org/en/Theme_settings#Sideblock_width

Left blocks seem to be 210px and right blocks 180px so try to set exact width for both in you theme config.php for example with

$THEME->block_l_min_width = 190;
$THEME->block_l_max_width = 190;
$THEME->block_r_min_width = 190;
$THEME->block_r_max_width = 190;

(so that images are not too wide to fit to blocks anyway)

In reply to Mauno Korpelainen

Re: HTML block not the same size on Right as Left

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
thanks Mauno! Sadly our school Moodle's hosted elsewhere and they aren't going to do a minor job for a minor person but when we eventually put it on our own server I'll give it a go smile
In reply to Mary Cooch

Re: HTML block not the same size on Right as Left

by Itamar Tzadok -
Mary, you may be able to use the same method I suggested for the block title colors to control the sides' width although if your images are wider it won't do unless you set the images' width accordingly.

smile
Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: HTML block not the same size on Right as Left

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Oh that would be useful! All the images are 160x120 so that won't be a problem - that's why I couldn't understand it; I didn;t realise they were 'set' to a different size. I don't know the code to add for adjusting the width though- I can understand, copy and adapt but not write it myself!
In reply to Mary Cooch

Re: HTML block not the same size on Right as Left

by Itamar Tzadok -
The blocks are in the left and right columns, so you can try adding to your local styles the following lines:

styleHtml+='#left-column {width:180px;}';
styleHtml+='#right-column {width:180px;}';

This, however, might not work in IE because IE has all these issues with max width and min width so some more lines may be needed for IE compatibility.

smile
Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: HTML block not the same size on Right as Left

by Mauno Korpelainen -

One difference between code in theme and code in blocks is also that the "theme code" is used always when theme (or parent theme) is used (block width may be different in different themes) and the "block code" is used when blocks are rendered (can be very useful if you need to change width of some blocks without touching theme files but does not work site wide)

Great idea, Itamar!

In reply to Itamar Tzadok

Re: HTML block not the same size on Right as Left

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
I just want to thank Itamar publicly for the help he gave me here and off forum with getting my blocks equal - thanks smile