Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2003
    Location
    Thailand
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using fonttypes in document.write

    Hi, all

    Is it possible, to use different types of 'fonts' in 'document.write',
    and if so, how?

    Thanks beforehands, for any response.

    greetings,
    dutchie

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Simply write the html (or CSS style) usual tags (atributes)

    document.write('<font face=\"Arial\">text here</font>');
    or
    document.write('<div style=\"font-family:Arial\">text here</div>');

    just take care that, in JavaScript, some characters, like " are special characters, so you have to use the backslash in front, to avoid code interpret them otherwise than part of a string.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •