|
|
#1 |
|
center an iframe with css?
Does anyone know how to do this? I had to use deprecated code to get it to center. I've tried div class center. But it's not working.
__________________
Macbook Leopard; Intel Core Duo, 2 Ghz 2 GB RAM Imac Panther and OS 9 G3 with around 300 RAM Mac still rules. My aging Imac can still run circles around some newer PC.
|
|
|
|
0
|
|
|
#2 |
|
Generally you do it the same as with other elements: margin: 0 auto; If that's not working, show the HTML/CSS you're working with and we might be able to offer something more specific.
|
|
|
|
0
|
|
|
#3 |
|
iframes display inline by default.
So if you are going with margin: auto; you will need to add display: block; as well. Also for auto margins to work an explicit width must be set on the iframe. This should work: Code:
iframe {
display: block;
width: 800px;
height: 400px;
margin: 0 auto;
border: 0;
}
Code:
<iframe src="http://www.apple.com/"></iframe> Last edited by elppa; Jun 26, 2011 at 03:52 PM. |
|
|
|
1
|
|
|
#4 | |
|
Quote:
That worked!
__________________
Macbook Leopard; Intel Core Duo, 2 Ghz 2 GB RAM Imac Panther and OS 9 G3 with around 300 RAM Mac still rules. My aging Imac can still run circles around some newer PC.
|
||
|
|
0
|
|
|
#5 | |
|
Quote:
When we ask for advice, it's not to be told by implication, "Hey, dummy, you should know enough that generally you do it the same as with other elements: margin: 0 auto." If we KNEW that much, we wouldn't be here asking for decent, complete and applicable information. No one is asking for implied insults. In the future, angelwatt, save yourself the time and bandwidth by not posting such useless and pedantic crap, and take a lesson from Elppa about how an information forum is supposed to work in sharing USEFUL information instead of trying to impress others with your useless prowess. We don't care what you know; on specific questions and trouble-shooting, we care about what you know which you are willing to share in detail as a colleague. (EOM) |
||
|
|
0
|
|
|
#6 | |
|
Quote:
Thank you.
__________________
Jim Goldbloom Sr. Web Developer, owner GoldTechPro, LLC http://www.GoldTechPro.com
|
||
|
|
1
|
|
|
#7 | |
|
Quote:
__________________
visit focused-e, my e-business company |
||
|
|
1
|
|
|
#8 | |
|
Quote:
I also sort of wonder what caused our new friend George to use his first and so far only post to angrily comment on an 18 month old thread. |
||
|
|
0
|
|
|
#9 |
|
I think newbies often don't notice dates, they're browsing many forums to get the answer to a common issue and usually copy/paste/try many solutions until one works. I do not at all condone what that guy did, nor did anyone who posted code or advice in any way do anything wrong, to be clear. I'm just stating I understand the frustration, I've been there and done that when I was first learning (and I still am learning, all the time). People often lose patience in this fast pace world of get it done, fix it now, get paid, etc. combined with little effort at learning. The Internet is a great resource, but people forget to be civil and that technical forums are bi-directional, both learning and teaching oriented. Some people expect Wikipedia here. That clearly isn't us.
Just some thoughts I wanted to express, I got it out, feel better now.
__________________
Jim Goldbloom Sr. Web Developer, owner GoldTechPro, LLC http://www.GoldTechPro.com
|
|
|
|
0
|
![]() |
|
| Tags |
| centering, divs, iframe |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Making iFrames affect outside iFrame with links in iWeb | GeekOFComedy | Web Design and Development | 1 | Jan 23, 2011 10:42 AM |
| Problems With Lightbox Inside An iFrame | Xonnie316 | Design and Graphics | 0 | Jan 30, 2010 05:05 AM |
| Use css to position an iframe within a div? | kevindosi | Web Design and Development | 2 | Jul 27, 2009 03:26 AM |
| vertically and horizontally centering an image in a table cell using CSS | torndownunit | Web Design and Development | 1 | Mar 8, 2009 07:52 PM |
| Center aligning linked images with CSS | Darran | Web Design and Development | 4 | Sep 3, 2008 08:36 PM |
All times are GMT -5. The time now is 04:41 AM.







That worked!

Jim Goldbloom
Linear Mode

