Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Si6776 on July 02, 2011, 09:50:54 AM

Title: Newsfader text alignment
Post by: Si6776 on July 02, 2011, 09:50:54 AM
I have several scrolling news items, of one, or two, lines, and with the default setting the board index 'jumps' when the newsfader scrolls from a one line item, to a two line item, and therefore increases in height. 

I have inserted a constant height value (see below), but now, when the one line items come up, the text is at the top of the newsfader container, rather than central.  Is there any way to get newsfader text to align vertically, so it's central in the box?

#smfFadeScroller
{
   text-align: center;
   padding: 0 2em;
   height: 40px;
   overflow: auto;
   margin: 1em 0;
   color: #575757; /* shouldn't be shorthand style due to a JS bug in IE! */
}
Title: Re: Newsfader text alignment
Post by: MrGrumpy on July 02, 2011, 09:58:39 AM
How I usually do it is set the height as a min-height and then add some padding top and bottom - like:


#smfFadeScroller
{
   text-align: center;
   padding: 1em 2em;
   min-height: 40px;
   overflow: auto;
   margin: 1em 0;
   color: #575757; /* shouldn't be shorthand style due to a JS bug in IE! */
}
Title: Re: Newsfader text alignment
Post by: Si6776 on July 02, 2011, 10:41:43 AM
Thanks - that will certainly get rid of the scroll bar, if I had to use more than two lines of text, but it still doesn't align the text vertically.  When there's only one line, the text appears at the top of the container.
Title: Re: Newsfader text alignment
Post by: YogiBear on July 02, 2011, 11:10:49 AM
Mis-alignment and jumpiness are known problems when using IE8 if that is of any help. The 'cure' is to run IE in Compatability Mode.

Title: Re: Newsfader text alignment
Post by: Si6776 on July 02, 2011, 11:17:48 AM
Funnily enough, IE8 exhibits a completely different problem, which I've posted in another thread.  :)