PDA

View Full Version : font control for document.write text


nickelsto
08-09-2002, 04:16 PM
can the font size be changed to very large in the document.write function? I could not get a larger than approximately H1 tag size font.
I didn't include all the other code but below is my current attempt at changing the font. The color change works, but not the size.

document.write("<TABLE BGCOLOR=#3321AB align=left>"+"<TR>"+"<TD>"+"<font size='25'>"+"<font color=#333366>"+DayName +
ThisDate+"</font>"+"</TD>"+"</TR>"+"</TABLE>");

Exodious
08-09-2002, 05:00 PM
add this to your document.write

<style>.docWriteStyle{font-size:40pt;}</style>

then use <font class='docWriteStyle'> instead of <font size='25'>

:thumbsup:

Roy Sinclair
08-09-2002, 05:20 PM
Originally posted by Exodious
add this to your document.write

<style>.docWriteStyle{font-size:40pt;}</style>

then use <font class='docWriteStyle'> instead of <font size='25'>

:thumbsup:

Except you should never use the <font> tag. Add the color to the style as well and apply the style to the TD tag. The <font> tag is deprecated (that means it still works but should not be used any longer and will eventually be removed from the standard). If you have a section of text in the middle of other text that requires special formatting use the <span> tag instead of <font>.

nickelsto
08-09-2002, 05:38 PM
Thank you, I appreciate the help