 |
HTML Help Please Search for the answer to your question before asking it! Thanks.
|
| View previous topic :: View next topic |
| Author |
Message |
alex_85
Joined: 05 Jun 2009
Posts: 10
|
| Posted: Mon Jul 27, 2009 10:47 pm Iframes |
|
|
Does anyone know how to make an image fit inside an iframe instead of half being cut off cos its too big?
ALSO how to make the background transparent in IE? |
|
|
PayneLess Designs
Joined: 28 Feb 2007
Posts: 4289
Location: MS
|
| Posted: Mon Jul 27, 2009 11:54 pm |
|
|
You want the transparency to be for a png/gif or opaque for a jpg? You can make backgrounds transparent for png/gif formats using any good graphics editor. Opacity is another matter:
IE Opacity Code: Code: filter: alpha(opacity=x)
"x" can be a value from 0 - 100. A lower value makes the element more transparent.
Firefox Opacity Code: Code: opacity:x
"x" can be a value from 0.0 - 1.0. A lower value makes the element more transparent.
Example: Code: <img src="image.jpg"
style="width:150px; height:113px; opacity:0.4;filter:alpha(opacity=40); alt="Text Description"" />
To fit an image inside an iframe, size the iframe to the image size. Be better if you post your iframe code and link to image you want to use. |
|
|
alex_85
Joined: 05 Jun 2009
Posts: 10
|
| Posted: Tue Jul 28, 2009 12:25 am |
|
|
| sorry i should be more clear. I just need the white of the iframe to dissapear. I dont want any background in the iframe |
|
|
alex_85
Joined: 05 Jun 2009
Posts: 10
|
| Posted: Tue Jul 28, 2009 12:38 pm |
|
|
and here's my code
imgId.innerHTML ="<iframe id=img src="+strImage+" width= 600 height=400 allowtransparency=true scrolling=no frameborder=0px></iframe>";
transparency doesn't work.
there are 1000 images for the iframe i was really hoping to not have to resize them all to fit... |
|
|
PayneLess Designs
Joined: 28 Feb 2007
Posts: 4289
Location: MS
|
| Posted: Tue Jul 28, 2009 3:08 pm |
|
|
Maybe this will work for you?
Code: imgId.innerHTML ="<iframe id='img' src='+strImage+' style='width:600px; height:400px; background:transparent;' allowtransparency='true' scrolling='no' frameborder='0p'></iframe>"; Can't run it, but you get the idea and might play with it. background: transparent; means just what it says. |
|
|
alex_85
Joined: 05 Jun 2009
Posts: 10
|
| Posted: Tue Jul 28, 2009 4:28 pm |
|
|
| yeah i did all that background transparent stuff. put it in my css for body, the iframe everything lol. i hate ie! |
|
|
PayneLess Designs
Joined: 28 Feb 2007
Posts: 4289
Location: MS
|
| Posted: Tue Jul 28, 2009 4:42 pm |
|
|
| It works for IE, but since I can't see or texs the code you are using locally, I am at a lost as to your exact problem. |
|
|
| |
|
|
|
Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group
|