vertical alignment of section summary text

vertical alignment of section summary text

by Mark Berthelemy -
Number of replies: 4
Hi,

I'm using the Standard theme in Moodle 1.5.2, with Firefox 1.0.6.

When I put in some summary text at the top of a section the text is not aligned with the section number (see screenshot attached).

In IE it displays fine, and the summary texts in this Using Moodle course display OK in Firefox. I've spent ages trying to work through the CSS files to see what's going on and the only element that I can see that might be affecting things is:

#course-view .section td {
vertical-align:top;
}


in styles_layout.css

I'd welcome any thoughts on this - it's starting to drive me just a little crazy. smile

All the best,

Mark
Attachment summary_layout.gif
Average of ratings: -
In reply to Mark Berthelemy

Re: vertical alignment of section summary text

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Mark,

It appears that the text is contained in some block level element e.g. <h2> or <p> which Firefox gives a default margin to. Assuming your text is enclosed in p tags, you could try adding the following to styles_layout.css

.content .summary p {
  margin: 0 0 10px 0;
}


PS You may find Andy's user script to help with making/debugging themes helpful in future. smile
In reply to Helen Foster

Re: vertical alignment of section summary text

by Mark Berthelemy -
Thanks Helen,

I'll take a look at that next week. I thought it might be a Firefox thing - it does strange things to bullet indents as well.

Andy's script looks useful - I've got the Firefox developer's extension but this seems to go even further.

I have noticed the same behaviour even when I took out the heading tags from the summary text, so it was just contained inside the tags....

Yours,

Mark
In reply to Mark Berthelemy

Re: vertical alignment of section summary text

by Andrew Walker -
Hello Mark,

If you're still seeing a gap above the text and you've removed any block-level elements from around it, it's possible that the HTML editor may have inserted a br tag before the text.

In the past I think i've found that Internet Explorer collapses line breaks that immediately follow small images (I guess in moodle there may be some kind of spacer or icon there that could cause that to happen) So if there is a line break in there it may only show up in other browsers.

If there is an extra br tag there, removing it should solve the problem.

Andy
In reply to Andrew Walker

Re: vertical alignment of section summary text

by Ray Lawrence -
Yes, I find this a lot with this type of editor. A quick look at the HTML in te editor normally shows the culprit.