Results 1 to 3 of 3

Thread: RTE and Display font

  1. #1
    Join Date
    Sep 2004
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default RTE and Display font

    1) Script Title: Rich Text Editor

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...itor/index.htm

    3) Describe problem: How can I change the font on the texarea from Times to arial?I have tried styling the textarea in the script but it does not work (see below).
    thanks for any info

    .
    .
    .
    if (!readOnly) {
    document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px; font-family: arial, sans-serif; font-size:0.80em;">' + html + '</textarea>');
    } else {
    document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px; font-family: arial, sans-serif; font-size:0.80em;" readonly>' + html + '</textarea>');
    }
    .
    .
    .

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't edit the script, then you can't used the compressed version. Make up a style sheet, call it -say, myEdit.css and put this in it:

    Code:
    body {
    	background: #fff;
    	margin: 0px;
    	padding: 0px;
    	font-family: arial, helvetica, sans-serif;
    }
    The highlighted lines should remain unchanged. If you change the background, you may need to add a color property to keep the text readable.

    Put this file in the same folder as your page with the RTE on it. Then where you do something like this in your page's code:

    Code:
    initRTE("images/", "", "");
    make it:

    Code:
    initRTE("images/", "", "myEdit.css");
    That will change the default font for the editor to Arial.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    andyc209 (12-11-2009)

  4. #3
    Join Date
    Sep 2004
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks for that,great fix

Bookmarks

Posting Permissions

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