If you put an iFrame or anything inside a table, it will stay aligned in the same place, no matter what the other visitor's resolution is? Coz I have a big resolution, and the people that viewed my temp layout noticed that the iFrame was a little off. When I look it's perfect... and realized the difference when I was sent a screen cap. Is this true, if so, how do you do this?
Dude128
07-25-2003, 02:45 AM
it depends on how you have the element positioned on the page. if you have a table that's 90% wide and the element is centered in it, it won't be in the same place on all resolutions. absolute positioning is really the only way I know of to make sure something is always in the same place with respect to the left and top of the page.
I was reading another post, and I noticed that after the number in the positioning code, it had "px"... will this keep it inline?
And, what about the table method? And, what are you talking about, I'm not quite understanding.
Dude128
07-25-2003, 03:06 AM
anything that is relative to the resolution will change. so if you use percentages, the amount of space will vary. if you center something, the amount of space on either side of that element (such as an iframe) will vary with the resolution.
so if you use a table that has a width of 90%, the size of the table will be different on each resolution. if you center something inside a table of any size, the horizontal position will vary.
because of that, absolute positioning is really the only way to get something to be the same distance from the left and top of the page on all resolutions.
I see.... so, what's the code for the absolute positioning of an iFrame?
All you have to do is add the positioning on to the style tag of the iframe. For example :
style=position:absolute; left:#; top:#
Of course, you have to merge any other style codes you have in your iframe tag and replace the #s with the correct positions.
Here's what you MIGHT end up with (don't ask what all the other tags are lol, it's just a finished example)
<iframe FRAMEBORDER="0" BORDER=0 width=250
height=500 src="http://aol.com" name=frame scrolling=no allowtransparency=true style="FILTER: chroma (color=AA0000); position:absolute; left:70; top:235"
></iframe>
If I also wanted my frame to be transparent in the background, would I have to include that "chroma" part in the code? Otherwise, I have all that other stuff, and the positioning still is differnet for others.
Hey, you just have to include the allowtransparency code for the transparent iframe. (Then on all the pages that open in the frame, the body background has to be transparent.) The chroma part is for transparent scrollbars.