View Full Version : Changing font in iFrame

11-17-2010, 12:44 AM
Okay so I'm trying to get my website to read this text document using iframes, which is working well except that the font is annoyingly notepad-esque (I don't know the exact font name, but one can tell that it is a text document rather than word). I'd prefer it if I was able to view the document in a different font. Is there any way to do this with iframes?
Basic code (ignoring all other aspects) so far:

<iframe ref="comments.txt"></iframe>

Where comments.txt is the text file I'm trying to get on the webpage. I can't just write the info on the webpage because the whole point of this is to have a document without html coding on it that can be edited which the website will then take as an update. This will make life a lot easier for those people who will be updating the site and are not familiar with html coding.
I hope that explains the problem...

11-17-2010, 03:14 PM
Because the file is a ".txt" file there will be no way of defining fonts in it. There is no DOM in a plain text file so nothing for the browser to "get hold of".

You could try loading the file into a variable, prepend and append the appropriate html code to it and add in some font code, then make the source of the iframe equal to the content of the variable.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum