Alan,

No, it is not an html question, but a css question, which is why I asked if
there was a way to do this using css. In any case, I tried both of your html
suggestions but neither one worked---apparently because they are html
solutions that apply to the target frame, not the content of the embedded
frame. I tried the various solutions at the iframe end and could not get any
to work. The solution was to do what I hoped to avoid: write a short
javascript function that creates the embedding document with its own
stylesheet wrapped around the picture source. Maybe there is a css way or
even an html way to do this without javascript, but I couldn't spend any
more time experimenting.

Thanks to everyone for taking the time to help.

Michael

----- Original Message ----- 
From: "Alan Gresley" <a...@css-class.com>
To: "Michael Newberry" <m...@mirametrics.com>
Cc: <css-d@lists.css-discuss.org>
Sent: Wednesday, November 11, 2009 4:55 AM
Subject: Re: [css-d] Is there a simple way to center in an iframe?


> Michael Newberry wrote:
>> I'm pasting images into an iframe using a simple click on a link. The 
>> image always appears at the 0,0 scroll position inside the iframe. Is 
>> there a simple css way to center it? I've tried using  text-align:center.
>>
>> Thanks,
>>
>> Michael
>
>
> Hello, Michael, since iframe is a deprecated inline element.
>
> http://www.w3.org/TR/html401/present/frames.html#edef-IFRAME
>
> There are two options using depreciated elements or depreciated
> attributes that will work.
>
> <div align="center"><iframe>
>
> content of iframe
>
> </iframe></div>
>
>
> <center><iframe>
>
> content of iframe
>
> </iframe></center>
>
>
> Pick your poison.
>
> BTW, this is a HTML question. I suggest that you learn these.
>
>
> 1. <http://www.w3.org/TR/html401/index/elements.html>
> 2. <http://www.w3.org/TR/html401/index/attributes.html>
>
>
> -- 
> Alan http://css-class.com/
>
> Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
> ______________________________________________________________________
> css-discuss [cs...@lists.css-discuss.org]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>


______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to