PAYTON2000 Posted December 28, 2006 Share Posted December 28, 2006 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 More sharing options...
Err Posted December 29, 2006 Share Posted December 29, 2006 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 More sharing options...
PAYTON2000 Posted December 29, 2006 Author Share Posted December 29, 2006 Thank You for your help. As I said I'm really new and i tried for 2 hours to put this code in and I can't get it to work. Is there anyway someone can put this code in where it belongs...before I hang myself !! LOLThanks Link to comment Share on other sites More sharing options...
PrateekSaxena Posted December 30, 2006 Share Posted December 30, 2006 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 More sharing options...
PAYTON2000 Posted December 30, 2006 Author Share Posted December 30, 2006 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 More sharing options...
PrateekSaxena Posted December 30, 2006 Share Posted December 30, 2006 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 More sharing options...
PAYTON2000 Posted December 30, 2006 Author Share Posted December 30, 2006 Again , I appreciate any help that anyone actually takes the time to help with this,,,,,,,,,,but it didn't work either. Link to comment Share on other sites More sharing options...
reportingsjr Posted December 30, 2006 Share Posted December 30, 2006 post the script you have so far, and if you have it up and hosted, a link to the page. Link to comment Share on other sites More sharing options...
PAYTON2000 Posted December 31, 2006 Author Share Posted December 31, 2006 Sorry I am still working on it , I don't have it up and running. The only thing I have is listed in my first post, after that I tried the suggestions but nothing seems to work.Thanks Link to comment Share on other sites More sharing options...
Err Posted December 31, 2006 Share Posted December 31, 2006 <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 More sharing options...
PAYTON2000 Posted January 1, 2007 Author Share Posted January 1, 2007 Thank You Very Much .....it works like a charm!!!! Link to comment Share on other sites More sharing options...
justsomeguy Posted January 2, 2007 Share Posted January 2, 2007 You can also change the text directly on the element itself:<div id="name" style="font-size: 18px;">test</div> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now