Results 1 to 3 of 3

Thread: Cross browser marquee: middle valign of text

  1. #1
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Cross browser marquee: middle valign of text

    1) Script Title: Cross Browser Marquee

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex2/cmarquee.htm

    3) Describe problem: Does anyone know of a way to center (middle) the vertical alignment of the text? I tried specifying
    Code:
    td valign="middle"
    in the table portion of the script, and
    Code:
    style="vertical-align:middle"
    both in the actual font around the text and in a div that I created around the entire script. Anyone have any other suggestions?
    Last edited by kmlynch; 12-12-2011 at 05:47 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The problem you're facing is that the text in the marquee is inside of several div tags inside of a table. As a result vertical-align and valign mean nothing. You can access the div that contains the text from a stylesheet with - say:

    Code:
    #iemarquee {padding-top: 3px;}
    Which works out about right for the demo page. But there is no vertical style for the div tag. It's contents are always at the top unless margin or padding are specified.

    You might be interested in:

    http://www.dynamicdrive.com/dynamici...wler/index.htm

    A slightly more complex script which can do what Cross Browser Marquee can do, and much more. The advantage with it here is that if you have a text only marquee and don't specify padding or margin, the script centers it vertically for you.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Specifying the top padding worked perfectly! I don't think I even noticed the divs inside of the script until you mentioned them - I can't thank you enough!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •