tags:

views:

123

answers:

2
+1  Q: 

align an iframe

I have a html page and I want to align an iframe at the bottom of the page such that the iframe occupies all the width , I am unable to align the iframe at the bottom.Please find the iframe tag at the bottom of the page.

<html>
<body>

<p>The rest of the code has not been mentioned to reduce code overflow.</p>
<p>I want to align the iframe after a long page having no. of jquery , images etc.</p>

<iframe src ="bottom.html" width="100%" height="200" style="float:bottom" scrolling="no" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
A: 
<iframe src="bottom.html" style="position:absolute; bottom:0px; height:200px; width:100%;" scrolling="no" frameborder="0">

Sorry. Try that instead.

Senica Gonzalez
Sorry , even this didn't work.
Gaurav
What browser are you using? And when you say it didn't work, what happened exactly? Did it move the iframe at all?
Senica Gonzalez
I am using firefox as well as Internet Explorer 8 , but the frame appeared near about the middle of the page in both the browsers, instead of at the bottom.So I moved it to the bottom using multiple <br> tags, which is a bad practise , but that gave the required output. So would like to get some help to find an alternative to thr <br> tag .
Gaurav
Thanks in advance.
Gaurav
Just tried in IE8 and Firefox 3.5 and both put the iframe at the bottom. I used this`<iframe src="info.php" style="position:absolute; bottom:0px; height:200px; width:100%; border:1px solid #000000" scrolling="no" frameborder="0"></iframe>`So I could see a border. Obviously you don't have the info.php page, so you'll have to replace with bottom.html, or whatever page you want. Can you post the bottom.html page? and is the code above all that you are working with right now or is it a shortened version?
Senica Gonzalez
Also, not sure that it will make a difference here, but do you have a doc type set?`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><iframe src="info.php" style="position:absolute; bottom:0px; height:200px; width:100%; border:1px solid #000000" scrolling="no" frameborder="0">Hello</iframe></body></html>`
Senica Gonzalez
check the link below for the actual page , the iframe is at the bottom.http://pastebin.com/JqnXkCHwPlease also check the bottom.html page source:http://pastebin.com/L6QgM7TF
Gaurav
I downloaded both pages and it seems to work correctly, except that your height is overwhelming. 680px takes up most of the screen. If you take that down to 200px or something you should see it at the bottom. There is a margin on the left side which is caused by your body tag, other than that, the div is at the bottom. Now, keeping it at the bottom while the page scrolls will require javascript. (jquery as you already are using)
Senica Gonzalez
changing the value to 200px didn't work, as the iframe src page is longer
Gaurav
Not sure if you ever figured this out or not. Perhaps I'm just not understanding what you are trying to accomplish with this.
Senica Gonzalez
A: 

Use top tag instead of bottom tag.

<iframe src="bottom.html" style="position:absolute; top:450px; height:200px; width:100%;" scrolling="no" frameborder="0">
Gaurav