setting font size in a iframe object (which reads a text file)

Discussion in 'HTML' started by Tom Van Overbeke, Jul 11, 2003.

  1. Hi,

    I created a web page that displays a logfile monitor i wrote for monitoring
    our servers. it refreshes every minute and displays a text file in an
    iframe. I'd like to reduce the font size so that more info fits in the text
    box, but i'm not too savvy in html, and the <font> tag doesn't seem to work
    here. does anyone know how to change the size (and if possible also the
    font) of the file (reverse-swatch.txt) that is loaded in the iframe ?

    this is my code:

    <html>
    <head>
    <title>Logfile Analyzer</title>
    <META HTTP-EQUIV="REFRESH" CONTENT="60">
    </head>
    <body>
    <iframe src="reverse-swatch.txt" width="100%" height=180>
    </body>
    </html>


    TIA,


    Tom.
    Tom Van Overbeke, Jul 11, 2003
    #1
    1. Advertising

  2. Tom Van Overbeke

    Jim Dabell Guest

    Tom Van Overbeke wrote:

    > I created a web page that displays a logfile monitor i wrote for
    > monitoring our servers. it refreshes every minute and displays a text file
    > in an iframe. I'd like to reduce the font size so that more info fits in
    > the text box,


    As far as I am aware, this is impossible. CSS and HTML styling doesn't get
    passed down to an <iframe> element's contents, and you can't style a
    plain-text file.

    One option that may be suitable is encoding your text file as an HTML file,
    and styling the text within that.

    --
    Jim Dabell
    Jim Dabell, Jul 11, 2003
    #2
    1. Advertising

  3. Tom Van Overbeke wrote:
    > I created a web page that displays a logfile monitor i wrote for
    > monitoring our servers. it refreshes every minute and displays a text
    > file in an iframe. I'd like to reduce the font size so that more info
    > fits in the text box, but i'm not too savvy in html, and the <font>
    > tag doesn't seem to work here. does anyone know how to change the
    > size (and if possible also the font) of the file (reverse-swatch.txt)
    > that is loaded in the iframe ?


    AFAIK with CSS you can't access the elements inside your iframe to style
    them. It may be possible with JavaScript (via
    document.frames('myframe').document.all), but I dunno.

    Maybe the easiest thing to do is to convert the .txt in a .html document:
    <html>
    <head>
    <title>My logfile</title>
    <style type="text/css">* { font-size: 8pt; }</style>
    </head>
    <body>
    <pre> <!-- here comes the content of reverse-swatch.txt --> </pre>
    </body>
    </html>

    Robrecht
    Robrecht Jacques, Jul 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    710
    Matt Berther
    Feb 20, 2005
  2. Vikas
    Replies:
    0
    Views:
    826
    Vikas
    Jul 15, 2003
  3. Duncan
    Replies:
    3
    Views:
    2,617
    Duncan
    Apr 29, 2004
  4. Eric
    Replies:
    0
    Views:
    314
  5. mttc
    Replies:
    2
    Views:
    2,393
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page