Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format text in document.write

Status
Not open for further replies.

mazdaman

Programmer
Oct 17, 2003
55
GB
I have the following code, but cannot seem to format the font that it displays.

Whole code with script in it.

<table width="999" height="74" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="340" background="images/homebotoomleft_14.gif"><table width="340" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30">&nbsp;</td>
<td class="whitetextsml">address here
T +44(0)20 855555 F +44(0)20 855555 E
<script language="JavaScript">
var stb_domain = "igd.uk.com"
var stb_user = "office"
var stb_recipient = stb_user + "@" + stb_domain
var stb_url = "mailto:" + stb_recipient
document.write(stb_recipient.link(stb_url));
</script>
</td>
<td width="10">&nbsp;</td>
</tr>
</table>
Thank you
 
This should really be asked in either the HTML (Forum215) or Javascript (Forum216) forums.

But here you go anyway...
Code:
document.write("<SPAN class='myClass'>"+stb_recipient.link(stb_url)+"</SPAN>");
and then in your stylesheet...
Code:
span.myClass  {font-family: Arial; font-size: 11px; font-weight: bold; color: #FF0000;}



Tony
________________________________________________________________________________
 
Cheers Tony - Thanks for pointing me to the right place.

I getting my commas wrong in the syntax.
 
whoops error !!
Its displaying but not showing the CSS style
 
are you defining the style in a stylesheet or in the .htm/.asp page itself?

Can you show the code you have now?

Tony
________________________________________________________________________________
 
<style>
.Sty{font-family:Comic Sans MS;font-size:15px}
</style>
<table>
<tr>
<td class='Sty'>asdasdasd
<script>
st="It is a good day to die, the day is not yet over."
document.write(st)
</script>
</td>
</tr>
</table>



worked fine for me...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top