views:

58

answers:

2

i am displaying a remote webpage on my site like this:

<iframe src="http://www.smopething.com/index.cfm"

frameborder="0"
width="800"
scrolling="no"
height="1100">

</iframe> 

is it possible for me to customize the size of it? something like <iframe src="etc", height=something,width=something> ???

+1  A: 

The best ways are:

For just height/width, IFRAME has height/width attributes, as seen in W3C spec.

For more control, enclose the iframe into a DIV element and then style the size of the DIV with CSS (it may work if you apply CSS directly to the IFRAME but I am not 100% certain of that)

DVK
can you please code that up
I__
Just add `width="800" height="1100"` to your IFRAME element attributes as you did
DVK
im not sure i understand since that code is already in the question
I__
+2  A: 

You can use CSS if you like:

<iframe src="http://google.com" style="width:640px;height:480px;"></iframe>

Or you could use the width and height attributes:

<iframe src="http://google.com" width="640" height="480"></iframe>
Jonathan Sampson
That markup isn't actually incorrect; the end tag is there so that you can enclose content for browsers that don't support iframes. The style tag will still work whether you self-close the tag or not.
Mark B
Ah, I see you were editing as I typed :)
Mark B
I__
@OP Make sure nothing is overwriting the styles/rules you're declaring.
Jonathan Sampson