PDA

View Full Version : Problem centering images in iframe


Revert
03-30-2007, 03:28 AM
Basically what I am trying to do is create a photo gallery. I have a bunch of little preview images on one side of the page, and on the right I have an <Iframe> that Im having the larger images open to. I just cant figure out how to make those images centered in the iframe though. Here is what I have basically:


<body>
<div id="Layer1">
<iframe src="web Images/Lifestyles/_MG_6567.jpg" name="iframe" frameborder="0" align="center" width="525" height="600"></iframe>
</div>
<img src="Lifestyles.jpg" width="1024" height="768" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="835,646,929,697" href="Home.html" />
</map>


Thanks for the help in advance

edbr
03-30-2007, 06:22 AM
what are the properties of "Layer 1"?

domedia
03-30-2007, 12:44 PM
Why on earth would you open an IMG in an IFRAME?
Drop the IFRAME tag, and insert he image directly ans set margin on it to create space.

<img src="image.jpg" style="margin: 40px;">

Revert
03-30-2007, 09:50 PM
Uh I don't know domedia....haha. Thanks I will try that and see what I come up with. Just for the heck of it....what is wrong with opening images in an Iframe?

Thanks again

domedia
03-30-2007, 10:02 PM
The iframe tag was created to load a different (external) html file into an existing html page. Today other websites usually give rss feeds instead.

Using an iframe to insert an image is like using a toaster to drive a nail in the wall; it might get the job done, but it's not too clever ;) Especially when there's a tool made specifically for that task, a hammer or the <img> tag dependig on your scenario