Solved

inline frame center alignment

Posted on 2013-11-22
12
309 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

832 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