468,512 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

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

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.

Jul 20 '05 #1
2 20097
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

Jul 20 '05 #2
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
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by fleemo17 | last post: by
14 posts views Thread by Roger Withnell | last post: by
2 posts views Thread by EnjoyNews | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.