News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Newsfader text alignment

Started by Si6776, July 02, 2011, 09:50:54 AM

Previous topic - Next topic

Si6776

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! */
}

MrGrumpy

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! */
}
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Si6776

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.

YogiBear

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.

SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Si6776

Funnily enough, IE8 exhibits a completely different problem, which I've posted in another thread.  :)

Advertisement: