Jump to content

Continues changing font colors?


PAYTON2000

Recommended Posts

I want to change the font color of my websites Header, I have found this code but it is way too small and I need to be able to make the font larger and the font different. Any ideas? I'm new(In case you couldn't tell !)This is the code I found:<HTML><HEAD><TITLE> test</TITLE><script type="text/javascript">var colors=new Array();colors[0]="blue";colors[1]="green";colors[2]="red";colors[3]="gray";colors[4]="orange";colors[5]="aqua";colors[6]="brown";colors[7]="black";colors[8]="purple";colors[9]="chocolate";colors[10]="magenta";colors[11]="violet";colors[12]="indigo";colors[13]="sienna";colors[14]="yellow";var i=0;function writemess(){ if (i==15)i=0;document.getElementById('name').style.color=colors;i++;setTimeout('writemess()',200)}</script></HEAD><BODY onload="writemess()"><div id="name">test</div></BODY></HTML>

Link to comment
Share on other sites

Use CSS.

<style type="text/css">html, body {  font-family: Arial;  font-size: 24px;}</style>

Stick that in between the <head> and </head> tags of your page. You can change the size and font to whatever you want.

Link to comment
Share on other sites

Try writing this - I want to change the font color of my websites Header, I have found this code but it is way too small and I need to be able to make the font larger and the font different. Any ideas? I'm new(In case you couldn't tell !)This is the code I found:<HTML>

<HEAD><TITLE> test</TITLE><script type="text/javascript">var font=new Array();font[0]="Arial";font[1]="Comic sans MS";font[2]="verdana";font[3]="tahoma";var colors=new Array();colors[0]="blue";colors[1]="green";colors[2]="red";colors[3]="gray";colors[4]="orange";colors[5]="aqua";colors[6]="brown";colors[7]="black";colors[8]="purple";colors[9]="chocolate";colors[10]="magenta";colors[11]="violet";colors[12]="indigo";colors[13]="sienna";colors[14]="yellow";var i=0;function writemess(){ if (i==15)i=0;document.getElementById('name').style.color=colors[i];document.getElementById('name').style.fontFace=font[i];i++;setTimeout('writemess()',200)}</script></HEAD><BODY onload="writemess()"><div id="name">test</div></BODY></HTML>

Link to comment
Share on other sites

Try writing this - I want to change the font color of my websites Header, I have found this code but it is way too small and I need to be able to make the font larger and the font different. Any ideas? I'm new(In case you couldn't tell !)This is the code I found:<HTML>
<HEAD><TITLE> test</TITLE><script type="text/javascript">var font=new Array();font[0]="Arial";font[1]="Comic sans MS";font[2]="verdana";font[3]="tahoma";var colors=new Array();colors[0]="blue";colors[1]="green";colors[2]="red";colors[3]="gray";colors[4]="orange";colors[5]="aqua";colors[6]="brown";colors[7]="black";colors[8]="purple";colors[9]="chocolate";colors[10]="magenta";colors[11]="violet";colors[12]="indigo";colors[13]="sienna";colors[14]="yellow";var i=0;function writemess(){ if (i==15)i=0;document.getElementById('name').style.color=colors[i];document.getElementById('name').style.fontFace=font[i];i++;setTimeout('writemess()',200)}</script></HEAD><BODY onload="writemess()"><div id="name">test</div></BODY></HTML>

I appreciate your help , but, this did not work either. It still just leaves the font very small and it doesn't change.
Link to comment
Share on other sites

Sooryy....I though It would work... try writing in the starting of the <script> -

document.getElementById('name').style.fontSize=20+'px';

Link to comment
Share on other sites

<HTML><HEAD><TITLE> test</TITLE><style type="text/css">html, body, #name {  font-family: Arial;  font-size: 40px;}</style><script type="text/javascript">var colors=new Array();colors[0]="blue";colors[1]="green";colors[2]="red";colors[3]="gray";colors[4]="orange";colors[5]="aqua";colors[6]="brown";colors[7]="black";colors[8]="purple";colors[9]="chocolate";colors[10]="magenta";colors[11]="violet";colors[12]="indigo";colors[13]="sienna";colors[14]="yellow";var i=0;function writemess(){if (i==15)i=0;document.getElementById('name').style.color=colors[i];i++;setTimeout('writemess()',200)}</script></HEAD><BODY onload="writemess()"><div id="name">test</div></BODY></HTML>

Try this code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...