Results 1 to 2 of 2

Thread: font size

  1. #1
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default font size

    Using this: http://www.dynamicdrive.com/dynamici...mikescroll.htm

    Problem: font size

    By default:
    myScroller1.setFont("Arial", 1);

    I actually want it exactly 8px. 1 is too small, 2 is too big. How do I convert it to 8px? I tried 8px and got script error.

  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

    From the demo page:

    Note that you can insert HTML tags in the item text to mix fonts. The defaults are "Arial,Helvetica" and 2 respectively.

    This means that you could also use span or division tags, ex:

    Code:
    myScroller1.addItem("<span class='scroller'>Click here for <a href='http://dynamicdrive.com'>Dynamic Drive</a>, the net\'s #1 DHTML site!</span>");
    If you were to do this for all myScroller1.addItem entries, the entire style, including font-size, could be controlled from a stylesheet:

    Code:
    <style type="text/css">
    .scroller {
    font-size:12px;
    }
    </style>
    - John
    ________________________

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

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
  •