iframes and Objects

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 16
Hi volks,

another iframe question:

I'm using strict XHTML and iso-8859-1 (because of german "umlauts")

head like 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- Styles -->
<link rel="stylesheet" type="text/css" media="screen" href="css/styles.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/navi.css" />

<!-- Script -->
<link type="text/css" rel="stylesheet" href="floatbox/floatbox.css" />
<script type="text/javascript" src="floatbox/framebox.js"></script>


and for the iframe:

<div style="float: left; margin: 0px; border: 0px;">
<iframe src="start-show.html" width="445" height="535" frameborder="0" scrolling="no">
</iframe>
</div>


Now I try to validade this floatbox nested in an iframe and it wont work.
... Floatbox displays and works but wont validade!

Is it possible to use the <object> tag instead of an iframe?

Any ideas ?


- - - -

PS:

zoom: 1

won't validade in XHTML strict too -
is there a workaround for this prob?
Member
Registered: Apr 2009
Posts: 16
OK now I use:

<object style="width:445px; height: 535px; 
border:0 px; overflow:hidden;" data="start-show.html" type="text/html">
</object>


and it validates.

Displays in Safari and Firefox, but what about IE 6-8?
Any experiences with object tag in IE 6-8?
Member
Registered: Apr 2009
Posts: 16
IE 6 and 8 won't display floatbox

IE 6 displays an object with scrollbars but no floatbox

IE 7 displays floatbox but with scrollbars
Administrator
Registered: Aug 2008
Posts: 3382
Hi basmati,
There's nothing in here about floatbox support, but I'll throw out a couple of opinions if you like.

First, I think you're placing too much emphasis on validation. Validation is a tool to make sure you're using proper html and haven't got any bone-head errors in your page code. But your objective should be to write page code that behaves and renders properly and error free in all your client's browsers. Sometimes this means intentionally writing code or css that does not validate. (Especially when writing for IE6 compatability).

When you say you are using strict XHTML 1.0 but you have iframes on the page, then you are in fact not using XHTML 1.0, regardless of what claims you make in your doctype header. But no browser will ever have problems parsing and rendering those iframe tags. The browsers are happy. If you want the validators to be happy too, you can use XHTML 1.0 Transitional as your doctype. Changing the doctype will not make any browser parse your html differently (unless you throw your page into quirks mode).

Yes, using <object> as a replacement for <iframe> doesn't work well in IE. So nobody does it. iframes are not going away any time soon.

The zoom:1 in the css is another case in point where you are over-reliant on the validators. It is in there because it helps some browsers. Any browser that does not recognize that css directive just ignores. You can safely delete it from your css if you like (but remember, you should be writing pages for your visitor's browser). It was just in there because someone had a globally applied zoom for anchors in their css which was messing up floatbox layout, and I try to make the floatbox css as compatible with other style-sheets as I can.

I hope this opinionated ramble gives you good food for thought. Cheers...
Member
Registered: Apr 2009
Posts: 16
admin wrote
First, I think you're placing too much emphasis on validation.


Yes, and maybe its because I'm "Germerman" :)

Hey, thanks for your answer - I think a change to transitional doctype will help ...

Page: 1