Minimum Height of an Iframe

D

David Morris

Can someone please tell me why the following two frames are not the same
size?

<html>
<head></head>
<body>

<iframe style="width:50px; height:50px;"
src="http://www.subway.com"></iframe>

<span style="width:50px; height:50px">
<iframe height="100%" width="100%" src="http://www.subway.com"></iframe>
</span>

</body>
</html>

It looks like when you put an Iframe into a div, it can't be shorter
than 150px. I only put it in the div so I can manipulate the iframes
height and width via javascript.

Thanx in advance.
 
D

David Dorward

David said:
Can someone please tell me why the following two frames are not the same
size?
<span style="width:50px; height:50px">
<iframe height="100%" width="100%" src="http://www.subway.com"></iframe>
</span>

<span> is an inline element and thus:

(a) Does not have height or width that can be influenced by CSS (at least
without making it a block)
(b) Can not, in HTML, hold a <div> element.

http://validator.w3.org/ is your friend.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top