Log in

View Full Version : Iframe distance from left,right,top, or bottom



IanMarlowe
07-26-2005, 05:35 AM
How can you specify how far an iframe should be from the lfet,right,top, ot bottom?

jscheuer1
07-26-2005, 06:03 AM
It depends. First off, generally you shouldn't. You should just allow it to be wherever it will fall in the normal flow of the page, or at the most float it using css style. If you must 'stick it somewhere' you can use any of the normal methods for doing so, like putting it in a table or setting its position to absolute or relative and then using top and/or left coordinates.

IanMarlowe
07-26-2005, 07:40 AM
but what if I have a form in the middle of the screen, and I want it on the left side of it?

thecraigmcrae
07-26-2005, 12:54 PM
Are you using tables to arrange your page? That's the best way to get your page fully aligned and positioned to your liking.
http://webmonkey.wired.com/webmonkey/96/47/index3a.html

IanMarlowe
07-26-2005, 01:00 PM
oh, thanks. and when you do border="0", it doesn't look stupid and unprofessional

jscheuer1
07-26-2005, 02:43 PM
You should be able to do it without a table. I always need to experiment when it comes to this though. I'd first try floating the iframe left. Then, if that didn't do what I wanted add in float right to the form. There are only the two elements and only four possibilities for float: left, right, clear and none. So it shouldn't take too long to get what you are looking for. The advantage of not using a table is that your layout is visible without horizontal scrollbars at any resolution, at any window width as wide as your largest element. With tables you add element widths together in the columns so more screen real estate is needed to display without horizontal scrolling.