?
Solved

inline frame center alignment

Posted on 2013-11-22
12
Medium Priority
?
323 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 44

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 44

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 44

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 44

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 44

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 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