Removing frame border when using HTML <OBJECT> tag to embed a child HTML document ...

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Removing frame border when using HTML <OBJECT> tag to embed a child HTML document into an HTML document in Internet Explorer.

---

Hi,

Does anybody here know how to remove the frame border when using HTML <OBJECT> tag to embed a child HTML document into an HTML document in Internet Explorer so that the 2 pages would be rendered altogether SEAMLESSLY?

Thanks a lot.


Problem description:

When using HTML <OBJECT> tag to embed a child HTML document into an HTML document (instead of using <IFRAME>), Internet Explorer (up to version 8 - don't know about the new version 9) renders the pages with a 3D inset border around the embedded page.

NOTE: This doesn't happen when using Mozilla Firefox (don't know about Google Chrome though - one of these days, I'm going to install Chrome on my computer and start testing my pages on it too). Personally, I think that this has something to do with the browser's Look and Feel (has anybody ever noticed that there is a 3D inset border around the page in Internet Explorer?).

---


P.S.: Below are the code snippets for the parent and child HTML pages:

Parent.html:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL]http://www.w3.org/TR/html4/strict.dtd[/URL]">
<HTML>
 
<BODY style = "background-color: #D3D3D3;">
   <OBJECT style = "width: 500px; height: 300px;"
           type = "text/HTML" [COLOR=red]data = "Child.html"[/COLOR]>
   </OBJECT>
</BODY>
 
</HTML>

Child.html:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL]http://www.w3.org/TR/html4/strict.dtd[/URL]">
<HTML>
 
<BODY>
   <P>(Child HTML document) --> Testing ...</P>
</BODY>
 
</HTML>
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

Can't be done in IE8 or below; the object frame will not respond to CSS applied to either the host document or the source document. That's the reason why web developers are still using <embed> for things like SVG graphics instead of <object>, and one of the reasons why <iframe> is still in heavy rotation even when dynamic client-side content changes are not required.

---------- Post added at 02:19 AM ---------- Previous post was at 02:10 AM ----------

Additional: as far as I've been able to determine, the reason you can't do it in IE is because MS uses an OS-native widget to display <object>s. It's the same reason why <select> elements will poke through any overlay <div>s. In this case, IE seems to be inserting itself (or its control variant) as an ActiveX control on the page in response to the object type.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

Thanks "essellar",

What about Internet Explorer 9? Are we going to have any control over it (be able to specify if we want or don't want the frame border around the embedded page) in Internet Explorer 9, do you (or anybody else) know? I'm using Internet Explorer 8 right now and I can't upgrade my browser to the new version 9 to find out since the requirement for its Operating System is at least Windows Vista or newer (Windows 7).

By the way, the reason that I switch from <IFRAME> to <OBJECT> is because of it is no longer supported in future HTML versions (specifically, HTML 5).

Thank you.

---

Food for Thought:

With <IFRAME> (or even with <FRAME>), you are able to turn on/off the border with the "frameborder" attribute. I don't know why they couldn't implement it with <OBJECT>.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

Um, section 4.8.2 of the current HTML5 spec document describes the <iframe> element and does not indicate deprication. I don't know where you heard that the <iframe> was going away in HTML5.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

Hi "essellar",

I haven't got a chance to look at the HTML 5's specification yet partly because right now it's NOT OFFICIAL yet (just a proposal), but (correct me if I'm wrong) to my understanding, anything that's NOT COVERED in the HTML 4.01 Strict Document Type Definition ("strict.dtd") is going to be deprecated in future HTML versions (may be not in the next version, which is version 5, but in the versions after that).

Thank you.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

... anything that's NOT COVERED in the HTML 4.01 Strict Document Type Definition ("strict.dtd") is going to be deprecated in future HTML versions ...

That's an unfounded assumption. HTML5 may not be a recommendation yet, but it is a working document, and the <iframe> element is part of that document (whether you're looking at the W3C or WHATWG version) and has been since the inception of the proposed specification. <iframe> has proven its utility in complex web applications like Gmail (which uses the plain HTML "HTML5" doctype) and others from the "heavy hitters" on the mailing list -- it's not going anywhere.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

You're right "essellar",

I looked up the HTML version information in W3.org, and according to the site at http://www.w3.org/TR/html4/struct/global.html#version-info:

The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents.

it doesn't actually say that <IFRAME> is going to be deprecated in future versions (my bad!!!). I guess this would mean that we can look forward to <IFRAME> being around for a long time then (hurray!!!).
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Re: Removing frame border when using HTML <OBJECT> tag to embed a child HTML document

Hi!

To all Internet Explorer 9 users,

I've uploaded the 2 HTML test documents ("Parent.html" and "Child.html") that I wrote in the thread's first post to my hosting account's test directory. If one of you would be so kind, PLEASE test the pages for me, and let me know if there's STILL a frame border around the embedded HTML page (I would test them myself, except that I'm using Internet Explorer 8 right now on Windows XP, and I can't upgrade my browser to the new version 9 since the requirement for its Operating System is at least Windows Vista or newer, Windows 7).

You can find the test pages at:

http://losthorizon.x10.mx/Test/Test%20(OBJECT).html

Thank you very much in advance.


P.S.: The embedded page/child HTML document ("Child.html") has white background, while the host page/parent HTML document ("Test (OBJECT).html") has gray background.
 
Top