Advertisement:

Author Topic: Newsfader text alignment  (Read 1176 times)

Offline Si6776

  • Jr. Member
  • **
  • Posts: 184
Newsfader text alignment
« 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! */
}

Offline MrGrumpy

  • Full Member
  • ***
  • Posts: 522
  • Gender: Male
  • AKA stikkki
Re: Newsfader text alignment
« Reply #1 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:

Code: [Select]
#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

Offline Si6776

  • Jr. Member
  • **
  • Posts: 184
Re: Newsfader text alignment
« Reply #2 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.

Offline YogiBear

  • SMF Hero
  • ******
  • Posts: 1,937
Re: Newsfader text alignment
« Reply #3 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.

SMF v2.0.15  Mods : Ohara YouTube Embed v1.2.9,  Custom Tab v1.2 , Bakers' Dozen Pages v1.2 , SMFPacks Shoutbox v1.1,  Board Color & Icons v1.1 , Simple Image Upload , Snow & Garland v1.4
PHP  v.7.2.7

Offline Si6776

  • Jr. Member
  • **
  • Posts: 184
Re: Newsfader text alignment
« Reply #4 on: July 02, 2011, 11:17:48 AM »
Funnily enough, IE8 exhibits a completely different problem, which I've posted in another thread.  :)