Results 1 to 3 of 3

Thread: About font color

  1. #1
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default About font color

    1) Script Title:

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

    3) Describe problem:

    Hi folks,


    About color of text/document, I tested follows;

    1)
    changing following line;
    Code:
    var marqueecontent='<nobr><font size="4"  face="Arial">.........

    as;
    Code:
    var marqueecontent='<nobr><font color="darkgreen" size="4" face="Arial">......
    It works


    2)
    changing following line;
    Code:
    var marqueecontent='<nobr><font color="rgb(255,0,0)" size="4" face="Arial">
    It doesn't work


    3)
    color="(255,0,0)"
    color="'rgb(255,0,0)'"
    etc.

    Also doesn't work.


    What will be the correct syntax for rgb? TIA


    B.R.
    satimis

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try using CSS instead, so something like:

    Code:
    var marqueecontent='<nobr><span style="font: normal 13px Arial, color: rgb(255,0,0)">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider linking to us by <a href="../link.htm">click here.</a> Enjoy your stay!</span></nobr>'
    Assuming rgb(255,0,0) is a valid rgb color value.

  3. #3
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Try using CSS instead, so something like:

    Code:
    var marqueecontent='<nobr><span style="font: normal 13px Arial, color: rgb(255,0,0)">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider linking to us by <a href="../link.htm">click here.</a> Enjoy your stay!</span></nobr>'
    Assuming rgb(255,0,0) is a valid rgb color value.
    Sorry, it doesn't work.


    Follow steps work;

    Code:
    <style>
    h { font-size: 24px; font-family: arial; font-style: nomal; color: rgb(0,0,205); }
    </style>
    goes to <head>


    Code:
    <h>The Text</h>
    goes to <body>


    B.R.
    satimis

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
  •