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

T

Tom Van Overbeke

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.
 
J

Jim Dabell

Tom said:
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.
 
R

Robrecht Jacques

Tom said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top