embedding a file on a page

admin

Administrator
Staff member
I'm sure this is a very basic question, but my HTML knowledge isn't enough to get search answers.<br />
<br />
I have a page and I would like to embed/include a .htm file in the page. I can create an href link, but I do not want the user to have to click to open the file. I just want the file opened in the middle of the page when the user opens the page.<br />
I've tried using <embed> tag, but either my parameters are incorrect or this is not the tag to use.<br />
<br />
Thanks for the help.<!--content-->In the future you will be able to use the OBJECT element, but for now you ned to use the IFRAME element:<br />
<br />
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/"><a href="http://www.w3.org/">W3C</a></iframe><br />
<br />
You will notice that I've included inside the IFRAME element a link to the file. Some browsers do not understand the IFRAME element and users of those browsers will get the link. <br />
<br />
See <!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/present/frames.html#edef-IFRAME">http://www.w3.org/TR/html401/present/fr ... def-IFRAME</a><!-- m -->. you very much - that was exactly what I'm looking for.<!--content-->I think what Charles meant was some browsers still have difficulty with the <object> element.<br />
<br />
Netscape 4.7x never supported <iframe> furthermore <iframe> was removed from XHTML 1.1 because of it being a rather unintelligent element to have in the first place - IFRAME was invented by Micro$oft.<br />
<br />
Supposedly even the <img /> could be deprecated at a future date in favour of <object> so I'll provide the <object> version below with fallbacks for older/other browsers.<br />
<br />
<object data="http://www.w3.org/" type="text/html" width="200" height="200"> <br />
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/" width="200" height="200"><a href="http://www.w3.org/">W3C</a></iframe><br />
<p><a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/">W3C</a></p><br />
</object><!--content-->Originally posted by Robert Wellock <br />
<object data="http://www.w3.org/" type="text/html" width="200" height="200"> <br />
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/" width="200" height="200"><a href="http://www.w3.org/">W3C</a></iframe><br />
<p><a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/">W3C</a></p><br />
</object> On would think, but then Microsoft comes around and ruins everything. he OBJECT element is supposed to work like the IFRAME element. It's supposed to either work or not. And if it doesn't work then the browser is supposed to display its contents. MSIE doesn't do that, so if you want to keep things forwards compatable:<br />
<br />
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/" width="200" height="200"><object data="http://www.w3.org/" type="text/html" width="200" height="200"> <br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http:// <!-- w --><a class="postlink" href="http://www.w3.org/">www.w3.org/</a><!-- w -->">W3C</a><br />
<p><a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/">W3C</a></p><br />
</object></iframe><!--content-->In other words invention of <iframe> was a very bad idea :D.<!--content-->I could not get the OBJECT or the EMBED tag to render HTML content in NS 4.7. It acts like it needs a plug-in to render the MIME type "text/html" (of course, there are none available to do that).<br />
<br />
I did have success using the LAYER tag.<!--content-->I don't have the rights to install Netscape 4.7x on this Novell Workstation - and I'm unofficially spooling Mozilla from CD-ROM - but I do have that browser at home (testing purposes).<br />
<br />
The <object> isn't always that well supported, or should I say it's very unpredictable in some browsers.<br />
<br />
For example Opera 7.0 cannot embed QuickTime using <object> it uses the proprietary <embed> even Netscape 4.7x manages to accomplish that simple task using <object> obviously yo'll have to have QuickTime plugin available..<br />
<br />
Gilbert, I never did ask you why you prefer Netscape Communicator 4.x to Mozilla 1.0 or one of the browsers based upon Gecko, please explain.<!--content-->Originally posted by Robert Wellock <br />
Gilbert, I never did ask you why you prefer Netscape Communicator 4.x to Mozilla 1.0 or one of the browsers based upon Gecko, please explain. Maybe you can't teach an old dog new tricks ;)<br />
<br />
I know my way around NS 4, and I guess I'm just comfortable with it.<br />
<br />
I don't like the "feel" of NS 6. It seems bloated to me (who needs all that "skin" crap, anyway?). I've never tried Gecko or NS 7. I am getting to like IE 5.5 though, mainly due to having to use it for work. But I'll stick with NS Messenger for my personal e-mail (It's too easy to get a virus using Outlook).<!--content-->Why not use a divison? This can be made cross browser compatible, but still look just like a iframe, and you don't have to meddle with more files.<br />
<br />
I believe Dave Clark has a really great example, which I copied :) (Thanks Dave!)<br />
<br />
<br />
I'll include here.<br />
<br />
<br />
<STYLE><br />
<br />
<br />
div.edit { position: relative; width: 500; height: 350; overflow-y: auto; font-size: <br />
10pt; font-family: tahoma; text-align: Left; text-indent: 20; <br />
line-height: 100%; clip: rect(0 500 350 0); list-style-type: <br />
font-family; float: left; left: 28; top: 108; border-style: <br />
inset; border-width: 2; padding: 4 }<br />
<br />
</STYLE><br />
<br />
<br />
Now.. somewhere in your body, you'll have to have this:<br />
<br />
<div id="txtBox" class="edit"><br />
<br />
your information here....<br />
<br />
</div><!--content-->Mozilla Phoenix: <!-- m --><a class="postlink" href="http://www.mozilla.org/projects/phoenix/">http://www.mozilla.org/projects/phoenix/</a><!-- m --> is a cut down version of Mozilla. <br />
<br />
K-Meleon <!-- m --><a class="postlink" href="http://kmeleon.sourceforge.net/">http://kmeleon.sourceforge.net/</a><!-- m --> is also based upon Gecko doesn't require much system overheads.<br />
<br />
Perhaps if you used the "Retro Skin" things would look more familiar there's a vast improvement for support of: XML, HTML and CSS and <object> in general pages render much faster than in Micro$oft.<br />
<br />
Perhaps you could consider trying one of those two if you are concerned about bloat; you can even make Mozilla spool from CD-R.<br />
<br />
Surely the learning curve cannot be that high :confused:.<br />
<br />
Nicodemas, the original question mentioned embed a file not just stylistics. That is why we are talking about <object>, anyhow it was a nice suggestion.<!--content-->
 
Back
Top