0

So I think I'm missing something on terms of iframes. If run this line of php code:

 echo"<iframe>sometext</iframe>"; 

The iframe shows up, but the text doesn't. Is there a way of doing this that works?

2
  • What are you trying to accomplish? iframes are used to include another HTML document or page within your page. You need to include an src attribute and define the location of the page you want to include. Commented Jul 27, 2012 at 21:28
  • 1
    Why would you use an iframe element to display text? Commented Jul 27, 2012 at 21:29

2 Answers 2

2

You don't put text between IFRAME tags. Instead, put the text you want in the page in a separate document, and use <iframe src="otherdocument.html"></iframe>.

If what you want is for some text to show up in a separate, scrollable frame, you could also use a DIV with the appropriate style settings (set an absolute or percentage height and width, and set overflow to scroll).

Sign up to request clarification or add additional context in comments.

Comments

0

This is not a good practice, but when you set some content, you have to set the iframe width and height

<iframe src="somefile" width="99" height="99></iframe> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.