5416339
5416339

Reputation: 417

What's wrong with this iframe?

Currently I'm using this:

<iframe frameborder="0" marginheight="0" marginwidth="0"
        height="100%" width="100%"
        src="http://www.google.com/search?q=<?php echo $plus ?>">
    </a>
</iframe>

No matter how much I increase the height percentage, it remains the same. The height doesn't change at all... Any ideas why?

This is related.

Upvotes: 0

Views: 338

Answers (3)

Blender
Blender

Reputation: 298196

You need to have a parent height. If your parent has no set height, what does 100% of that height mean? Try this:

html, body, #your_parent
{
  height: 100%; /* Or some other value. You get the idea, right? */
  width: 100%;
}

Change those percents to whatever you like, just have some height and width to reference to. Also, remove that </a> closing tag. It shouldn't belong there.

Good luck!

Upvotes: 0

Almost Famous
Almost Famous

Reputation: 599

It will only span the height of the parent element.

So if this iFrame is in your html/body element without height definition it will default to the browser height.

http://www.xs4all.nl/~peterned/examples/csslayout1.html

If you don't want to use CSS you will need to define the height of the body tag and all child elements thereafter.

Upvotes: 1

wajiw
wajiw

Reputation: 12269

Did you try removing the </a> from the tags?

Also, 100% is going to fill the container element. Make sure you have position:relative; in your element's styles and you have their heights/widths setup properly.

Upvotes: 0

Related Questions