Forum Moderators: open

Message Too Old, No Replies

Setting up xhtml 1.1 DTD for iframes

         

twist

9:18 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is website that explains how to do this but I can't seem to get it to work. A while ago, DrDoc, made a great simple example on how to include the embed tag using a dtd. If someone, maybe the doc, could do the same for a iframe tag that would be great. Thanks.

Here is DrDocs example thread,

[webmasterworld.com...]

birdbrain

10:37 pm on Mar 12, 2004 (gmt 0)



Hi there twist,

You might like to consider the object element
as a replacement for the iframe. Try this....


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>object iframe</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/

body
{
background-color:#cccccc;
}

#obj
{
position:absolute;
left:50%;
top:50%;
margin:-150px 0 0 -250px;
}

#links
{
position:absolute;
top:2%;
left:2%;
width:200px;
padding:10px 0 10px 0;
border:solid 1px #000000;
background:#ffffff;
text-align:center;
}

a
{
color:#000000;
}

object
{
width:500px;
height:300px;
border:solid 1px #000000;
background:#ffffff;
}
/*//]]>*/
</style>

<script type="text/javascript">
//<![CDATA[
function objectIframe(which)
{
document.getElementById('obj').innerHTML =
'<'+'object type="text/html" data=" '+which.href+' " ><\/object>';
}
//]]>
</script>

</head>
<body>

<div id="obj">
<object type="text/html" data="http://www.w3schools.com/"></object>
</div>
<div id="links">
<a href="http://www.w3.org/" onclick="objectIframe(this); return false;">
www.w3.org</a><br />
<a href="http://www.webmasterworld.com/" onclick="objectIframe(this); return false;">
www.webmasterword.com</a>
</div>

</body>
</html>

birdbrain