IFrames Positioning Help

liunx

Guest
I'm not much of a coder so bare with me. I have a site I'm building, and I've got one Iframe on there, positioned where i like it using this css style in the header <br />
<br />
<style type="text/css"> <br />
<br />
#floatframe {position:absolute; <br />
<br />
left: 43px; <br />
<br />
top: 120px; <br />
<br />
width: 280px; <br />
<br />
height: 500px; <br />
<br />
z-index: 100 <br />
<br />
} <br />
<br />
</style> <br />
<br />
and this for the iframe <br />
<br />
<iframe width="280" height="500" name="floatframe" src=http://www.webdeveloper.com/forum/archive/index.php/"news.html" align="left" frameborder="0"> <br />
<br />
well, I want one more I frame on my page in a completely different location and size, so I cant use this same style. <br />
Can someone help me? I know theres a way.<!--content-->Use a different style if you want different iframe. Like this?<br />
<br />
<style type="text/css"> <br />
#floatframe {<br />
position:absolute; <br />
left: 43px; <br />
top: 120px; <br />
width: 280px; <br />
height: 500px; <br />
z-index: 100;}<br />
<br />
#floatframe2 {<br />
position:absolute; <br />
...etc.}<br />
</style><br />
<br />
<iframe id="floatframe" src=http://www.webdeveloper.com/forum/archive/index.php/"news.html"><br />
<iframe id="floatframe2" src=http://www.webdeveloper.com/forum/archive/index.php/"another.html"> <br />
Also, it is better to use id instead of name. Name, align and frameborder have been deprecated.<br />
<br />
I'm not sure what the problem here is, really. What exactly do you want?<br />
<br />
________EDIT_____<br />
name doesn't even work on my ie6, so use id<!--content-->Originally posted by King Pellinore <br />
it is better to use id instead of name. Name, align and frameborder have been deprecated ... name doesn't even work on my ie6, so use id.<br />
<rant>Just so you'll know the advantage of using a NAME attribute: <br />
<br />
If you do, you would be able to use it as a TARGET for a regular HTML link. Some short-sighted group at W3C has forgotten what the NAME attribute was used for, and how many of us dislike javascript navigation. Without NAME and TARGET, you can't use FRAMEs without javascript. IFRAME is supposed to be a more versatile FRAME that is inline with the rest of the document.</rant><br />
<br />
Keep using the NAME attribute if you intend to code for those who don't use javascript. You will be able to get around the problem of being "HTML 4.01 Strict" is to use the proper doctype that matches an earlier HTML level, or specify "loose" rather than "strict".<br />
<br />
BTW, the NAME attribute is still *plenty* valid for items like form elements, anchors and images. The ID attribute is unique, and is used for scripting and assigning CSS styles.<!--content-->Originally posted by gil davis <br />
<br />
BTW, the NAME attribute is still *plenty* valid for items like form elements, anchors and images. The ID attribute is unique, and is used for scripting and assigning CSS styles. <br />
<br />
Well, for form elements and <iframes> names is perfectly OK, but I fail to see the use of it for anchors and images.<br />
Also, name is as uniqe as id.<br />
<br />
In any case, using <iframe> in the first place requires a Loose DTD, so target not beeing avalable in Strict is not an issue :)<!--content-->Originally posted by Stefan <br />
but I fail to see the use of it for anchors and images.<br />
Used in anchors so that you can navigate to a specific part of a document. Thus:<br />
<br />
<a name="part2"></a><h1>Part II</h1><br />
<br />
In your table of contents, you would have a link:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"part2">Part II</a><br />
<br />
The image name allows something you would "fail to see the use of" anyway - access for scripting. Although you can get the image using an ID, you would be able to support older browsers (version 3 and 4) by using the NAME attribute as an index to the "document.images" array (as opposed to "document.getElementById(...)").<br />
<br />
IE browsers copy any ID into the NAME attribute to cover lazy (or ignorant) coders (I believe that this is not a correct implementation). From other comments on this forum, I take it that the W3C has recognized it's error in eliminating the "TARGET" attribute, and plan on putting it back when the "FRAME" reccommendation is upgraded.<!--content-->Originally posted by gil davis <br />
Used in anchors so that you can navigate to a specific part of a document. Thus:<br />
<br />
<a name="part2"></a><h1>Part II</h1><br />
<br />
In your table of contents, you would have a link:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"part2">Part II</a><br />
<br />
<br />
But you might as well use<br />
<a id="part2"></a><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#part2">Part II</a><br />
<br />
(the # is btw needed in the case of name too)<br />
<br />
<br />
The image name allows something you would "fail to see the use of" anyway - access for scripting. Although you can get the image using an ID<br />
<br />
<br />
Exactly...<br />
<br />
<br />
you would be able to support older browsers (version 3 and 4) <br />
<br />
<br />
If you need to support old browsers that doesn't understand id, then you can provide both id and name with the exact same value in both.<br />
<br />
There is nothing preventing you to only use Name (as long as you code HTML only), but you are making it real hard on yourself if you ever intend to start coding according to the W3C DOM or with XHTML/XML.<br />
<br />
<br />
IE browsers copy any ID into the NAME attribute to cover lazy (or ignorant) coders (I believe that this is not a correct implementation). <br />
<br />
<br />
Actually it is, becuse the name attribute "share namespace" with the id attribute. In essence they are the same.<br />
<br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/struct/links.html#anchors-with-id">http://www.w3.org/TR/html4/struct/links ... rs-with-id</a><!-- m --><br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#h-4.10">http://www.w3.org/TR/xhtml1/#h-4.10</a><!-- m --><br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#C_8">http://www.w3.org/TR/xhtml1/#C_8</a><!-- m --><!--content-->
 
Back
Top