User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 375,193 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,200 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 1043 | Replies: 4
Reply
Join Date: Jan 2008
Posts: 4
Reputation: welshbaloney is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
welshbaloney welshbaloney is offline Offline
Newbie Poster

Keep iFrame positioned inside centered <div>?

  #1  
Jan 12th, 2008
Hello,
I have a simple page that consists of an image, some map hotspots, and an iframe that displays content when the hotspots are clicked:

<div id="wrapper">
<img src="blah.gif" />
...
some <area...target="iFrame"> tags
...
<iframe id="iFrame" src="home.htm">No iframe support!</iframe>
</div>

With the wrapper naturally aligning to the top/left of the browser window, the iFrame is aligned correctly in relation to this.

However, I want to center the image on the web page. When I align="center" the wrapper div, the iFrame stays where it is - misaligned.

When the browser page is adjusted and the wrapper div centers in the new browser window, how can I ensure that the iFrame position adjusts to maintain its position relative to the wrapper?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 144
Reputation: JonathanD is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
Colleague
JonathanD's Avatar
JonathanD JonathanD is offline Offline
SEM Rockstar

Re: Keep iFrame positioned inside centered <div>?

  #2  
Jan 16th, 2008
you could try inline CSS for the iframe like GoogleAds
fading...slowly...I give it all to you
Reply With Quote  
Join Date: Jan 2008
Posts: 4
Reputation: welshbaloney is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
welshbaloney welshbaloney is offline Offline
Newbie Poster

Re: Keep iFrame positioned inside centered <div>?

  #3  
Jan 16th, 2008
Thanks for replying JonathanD,
I'm not sure what you're referring to. Can you offer an example?

Thanks
Tony.
Reply With Quote  
Join Date: Aug 2005
Posts: 144
Reputation: JonathanD is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
Colleague
JonathanD's Avatar
JonathanD JonathanD is offline Offline
SEM Rockstar

Re: Keep iFrame positioned inside centered <div>?

  #4  
Jan 17th, 2008
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><style>a:link,a:visited,a:hover,a:active{color:#0000ff;cursor:pointer;}body,table,div,ul,li{font-size:10px;margin:0px;padding:0px}body{background-color:transparent;font-family:arial,sans-serif;height:100%}#aus{height:250px;width:300px}#ads{left:2px;position:absolute;top:2px;width:296px}#ads ul{list-style:none;}#ads ul li{clear:both;float:left;height:116px;overflow:hidden;width:296px}.ad{margin:0px 2px}.adt{font-size:13px;font-weight:bold;line-height:14px;}.adb{color:#000000;display:block;font-size:13px;line-height:14px;}.adu{color:#009900;font-size:10px;line-height:12px;overflow:hidden;white-space:nowrap}.adus{cursor:pointer;}.adc{width:100%;height:116px;table-layout:fixed;overflow:hidden}#abgi{left:220px;position:absolute;top:233px}#aubg{background-color:#ffffff;border:0px solid #ffffff;display:none;height:250px;width:300px}.bg{background-color:#ffffff;border-color:#ffffff;border-style:solid;border-width:0px;height:18px;position:absolute;width:18px}#tlc{background-color:#ffffff;border-left-width:0px;border-top-width:0px;left:0px;top:0px}#trc{background-color:#ffffff;border-right-width:0px;border-top-width:0px;left:282px;top:0px}#blc{background-color:#ffffff;border-bottom-width:0px;border-left-width:0px;left:0px;top:232px}#brc{background-color:#ffffff;border-bottom-width:0px;border-right-width:0px;left:282px;top:232px}#bgtf{border-top-width:0px;left:18px;top:0px;width:264px}#bgbf{border-bottom-width:0px;left:18px;top:232px;width:264px}#bgcf{border-left-width:0px;border-right-width:0px;height:214px;left:0px;top:18px;width:300px}</

something like that, inline CSS might work.
fading...slowly...I give it all to you
Reply With Quote  
Join Date: Jan 2008
Posts: 4
Reputation: welshbaloney is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
welshbaloney welshbaloney is offline Offline
Newbie Poster

Re: Keep iFrame positioned inside centered <div>?

  #5  
Jan 19th, 2008
Ah...so you mean explicitly putting the CSS into the file rather than external in a .css file.
I'll give that a try. Thanks for helping.

Tony.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb HTML and CSS Marketplace
Thread Tools Display Modes

Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 2:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC