How do I put an iframe on a page without using two html pages?

I’m making a site right now and I’m using iframes just so that a large body of text would not take up so much space. The thing is, I don’t know how to add an iframe to a page without having to make another html page of the iframe’s text for the iframe to call on. I’m dealing with quite a few files here and I don’t want to have to end up with double the amount of html files just because of iframes.

Can anyone help me out? Sorry for the uninteresting GQ question, but I’d really appreciate any help!

Oh, if it helps any, this is what I tried to do:

<iframe … >This is the text I want to appear in the iframe.</iframe>

I came up with a blank white box. I right clicked on it and it was the about:blank page. :-\

No - iFrame is a frame element, and therefore all it can reference is another HTML file (you can’t even make self-referential iFrames either - I’ve tried).

If it’s just text, why not go for

<TEXTAREA cols=X rows=Y>The text you want here.</TEXTAREA>

This will automatically insert a scrollbar if needed.

If you don’t want the text to be editable, use an onFocus=javascript:blur(); element in your leading textarea tag. You can also use style tags to change the font.

BTW, in case you didn’t realise, the board’s built-in hacker-resistant code changed “javascript” into two words - it should only be one.

That’s perfect! Thank you so much! All I need is to change the font, make the textarea transparent, and modify the scrollbar (I can do all those, right?) and it’s all set!

Thank you x100000! :smiley:

Even better you can add CSS to make a better looking box. And it wont’ be editable.

Check out the CSS I used on this site.

Here’s the CSS:

There’s another way of doing it - use a DIV tag with a scrollbar - here’s an example (stolen from someone else’s site):

<div align=“left” name=“I1” style=“padding-left: 10px; scrollbar-face-color: #ffffff; scrollbar-highlight-color: #ffffff; scrollbar-shadow-color: #ffffff; scrollbar-3dlight-color: #999999; scrollbar-arrow-color: #660033; scrollbar-track-color: #cccccc; overflow:auto; border: 1 solid #000000; background-color: White; width:413; height:100”>
Your text here
</DIV>

Thank you both! I appreciate this greatly! :slight_smile:

I’m not trying to tell you what to do, and I’m by no means dissing the advice of ZipperJJ and jjimm, but I think you should know that all those scrollbar properties are not valid CSS2, so your code won’t validate if you use them. I think they’re specific to IE.