Tutorials » Javascript » Using iFramesCode It
The first thing you have to do is setup the code on the page where you want the iframe. I'll list all the attibutes and what they do so you can keep or change them.
Place It...in the correct place. Hopefully you work with div layers. I'm not too familiar with any other layout setup. Positioning is everything, so depending on where you want it, you should have it in it's own div layer. Divs look a little like this: <div style="position:absolute;top:0;left:0;">text text text</div> All you have to do is add pixel amounts to the top and left to put the frame anywhere on your page you want it. Just make sure where the frame is placed leaves enough room for everyone to see the entire page. You don't want people scrolling the main page left to right. That gets annoying. Picture ItIf your layout has a graphic in the background, or as the background, you'll need to do a few more steps to get it in the right position. First you need to actually place your graphic on the page. What I would do to make life easier is to put the graphic in its own div layer, close to your iframe's div layer. Like this... <div style="position:absolute;top:0;left:0;"><img src=""></div> <div style="position:absolute;top:0;left:0;"><iframe code></div> Than all you have to do is find out where your iframe needs to go on your graphic - which is easy. Using PSP7, all you have to do is click on the graphic. In the lower left-hand corner of your screen you will see the statistics bar. It changes when you move your mouse over the graphic. This gives you the exact dimentions you need. Follow these iframe steps:
View your page so far. Where is your graphic on the page? Find out by Print Screening the window. While viewing your page, click Print Screen SysRq + Alt on your keyboard. Go into Paint or Paint Shop Pro and press Ctrl+V. An image of your window will come up. The same way you found the dimentions of the place you wanted your iframe, find your graphic. Click on the picture below to see how it's done. ![]() Then go to the div layer of your iframe. Replace the top and left alignments of the iframe code with the (00,00) stats of what you just did (step 6 on the image above) PLUS the (00,00) stats you got before (step 3 of iframe steps). The first "00" is left, the second "00" is top. Here is an example iframe layout I made to show you what I mean. ![]() Clear ItIf you have an image in the background like above, and you want to make the iframe transparent instead of the background color it is, you just need to slip in a few codes. Code #1 is for the iframe code. Place it in with the other attibutes. Code #2 is for the page that you have in your iframe. It goes inside your first <body> tag as an attribute. Know ItWhen you make an iframe, you have to know what you're doing. Hopefully this tutorial has helped you out in that area. If you're still having trouble, check out the Wiki page. |

