View Full Version : I-Frames

07-31-2006, 11:05 AM
Hello, I've searched a bit of the past threads and found similar topics but found them hard to understand so thought it might be easier for me if they are specific to my website...
I'm trying to validate my website, well at least the main pages, and I would like to use i-frames. I have no problem with them on an un-validated page, but as soon as I try and add a doctype or anything (Which I don't understand much about either), they aren't positioned where I put them using 'div' and 'absolute positioning'.
Here is an example of my unvalidated page http://butterfly-magic.net/strawberry/magic.html
and this is my attempt at validating which mucks up my iframes

Feel free to ignore this post if you don't like the way I've gone about asking or think I am stupid, but I'd like some help :)

08-01-2006, 05:30 AM
i think you have to set properties for iframe as width and height.
thats is the problem ur facing now

check javascript also

do onething put that javascript code where u created table for content

08-01-2006, 06:17 AM
With a DTD you must specify units in style:

<div style="position: absolute; top:138; left:32;">

should be:

<div style="position: absolute; top:138px; left:32px;">

Note: for the width and height attributes like, for example:

<iframe width="100" height="250" . . .

The units are assumed to be pixels unless % is specified and only % can be specified, no other units are allowed.

Rule of thumb: In style, units must be specified. In attributes, what you are used to is probably correct.

Also, you shouldn't use a frameset DTD with iframes (it is only for a framset page), use a loose transitional DTD for those, example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

Strict is generally the best type of DTD but, with iframes or frames, especially if your links use the target attribute, you can run into trouble getting them to validate.

That should get you started . . .