Valid iframe in XHTML Strict
Sooner or later, embedding iframes will become necessary for a project. Do not fear: object is here.The object tag is used for embedding objects such as flash and video in pages. It can also embed another page, which is what this article will explain.
Perhaps an example is the best way to show:
<object data="a.htm" type="text/html"></object>
It seems simple enough: the tag use seems exactly like embed. Even most major browsers render the object tag properly... except for Internet Explorer.
Here is where it gets tricky: keeping the valid object tag, while making sure Internet Explorer users get the same enjoyment. Nevertheless, Internet Explorer maintains IE-Conditional tags, which work only IE. To all other browsers, the statement looks like comments.
<!--[if IE]>...your code...<![endif]-->
Combining both the object tag with the iframe tag in IE-conditional and a little CSS magic, the code ends up:
<object data="a.htm" type="text/html" class="a"></object><!--[if IE]><style type="text/css">.a { display:none;}</style><iframe src="a.htm"></iframe><![endif]-->
Serve with a side of styling, and the page is ready to go!