I have two html files.

FirefoxBug.html

<html>
<body>
<div style=background-color:red;>
<iframe src="/iframe.html"></iframe>
</div>
</body>
</html>

And iframe.html

<html>
<body style=background-color:blue;>
<div>
<p>This backgroud should change</p>
</div>
</body>
</html>

I have these two files in the same folder on my desktop, and I am not sure why the iframe will not load.

Is a DTD type required for iframes to work?

Thanks, sj

Got it working.

<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<style>
div{background-color:red; padding:5em;}
</style>
</head>

<body>
<div>
<iframe src="iframe.html" ></iframe>
</div>
</body>
</html>

and iframe.html

<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; 
charset=ISO-8859-1"/>
</head>
<body>
<div>test iframe</div>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.