PDA

View Full Version : About font color



satimis
03-09-2008, 11:05 AM
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;

var marqueecontent='<nobr><font size="4" face="Arial">.........



as;

var marqueecontent='<nobr><font color="darkgreen" size="4" face="Arial">......


It works


2)
changing following line;

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

ddadmin
03-09-2008, 05:59 PM
Try using CSS instead, so something like:


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.

satimis
03-10-2008, 01:44 AM
Try using CSS instead, so something like:


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;



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

goes to <head>




<h>The Text</h>

goes to <body>


B.R.
satimis