PDA

View Full Version : Resolved Cross browser marquee: middle valign of text



kmlynch
12-12-2011, 05:01 PM
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
td valign="middle" in the table portion of the script, and
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?

jscheuer1
12-12-2011, 05:36 PM
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:


#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/dynamicindex2/crawler/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.

kmlynch
12-12-2011, 05:42 PM
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!