?
Solved

inline frame center alignment

Posted on 2013-11-22
12
Medium Priority
?
319 Views
Last Modified: 2013-12-29
Here is the page, http://lakecountyshoppingguide.com/latestissue/default.html .  I have an inline frame with a flash slide show embedded.  I am trying to center it in the page but it just stays left justified in IE and Firefox.  It is centered in Chrome.
0
Comment
Question by:northernknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
12 Comments
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39671006
Do you have access to the iframe code?
If not then we can't do any thing for it
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39671234
You can't change the content of the iFrame, but you can change the dimensions of the iFrame itself, and it will centre.

<iframe style="width: 800px; height: 600px;" src="../nov2013/shoppingguide/shoppingguide.swf" name="I1" marginwidth="100" id="I1">
...
</iframe>

Open in new window

0
 
LVL 1

Author Comment

by:northernknight
ID: 39672231
Yes, I have access to the iframe code.
I can center the  iframe but the flash slide show is left justified.  I need to be able to center the slide show.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 39672488
Your whole page is a little off throughout. The iFrame is wrapped in a 900px wide P tag, which is wrapped inside a 570px wide column1 DIV. The actual Flash movie inside your iFrame is set to a width of 100%, but this won't scale it - it just adds white space to the right. You can't centre an element that is 100% wide.

There are several ways of acheiving what you want - you could centre the P in the DIV, you could centre the iFrame in the P, or you could centre the Flash movie in the iFrame.

Which ever method you choose, you will need to sort out your widths.

To centre the iFrame, remove the width and float from #column1. Then change the width of your iFrame from 900px to 800px. That will centre the iFrame. There is no such thing as float:centre so remove that from your iFrame.
0
 
LVL 43

Assisted Solution

by:Chris Stanyon
Chris Stanyon earned 2000 total points
ID: 39672490
If you want to centre the slideshow within the iFrame, then in the page that contains it, change the width from 100%  to 800px and add a text-align:center to the <body> tag
0
 
LVL 1

Author Comment

by:northernknight
ID: 39673243
The auto-style1 has the text align center tag in it already.  I think I need to redo the flash show to not have the 100%

The column tag is site wide and is in the master template and css.  The last flash show I had in there was centered, but I just changed it.  So I will take a look at the new one.
0
 
LVL 43

Assisted Solution

by:Chris Stanyon
Chris Stanyon earned 2000 total points
ID: 39673397
Yes - the auto-style1 does have text-align:center, but you also set that paragraph to a width of 900px, so the content is centred within that width.

Having a site-wide column that is 570px wide, and trying to force 800px wide content into it will always cause you problems. You may need to re-think that part.

Probably the easiest thing to do here is to chagne the width of P tag to 970px, and then change the width of your iFrame to 800px;

That will centre the whole thing
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39673729
agree with @ChrisStanyon

Try to add below lines in iframe. might might might help

<!DOCTYPE html>
<html>
0
 
LVL 1

Author Comment

by:northernknight
ID: 39675956
So I changed the margins but it still only centers in Chrome but not IE and Firefox.
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39676324
Looks centred to me - tested in Firefox, Chrome and IE - centred in all of them

Maybe clear your cache and try again.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question