Solved

inline frame center alignment

Posted on 2013-11-22
12
310 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 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 500 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 500 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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