views:

65

answers:

1

Hi,

I have this Iframe which I'm looking to center using css, but is there a way to do it without specifying the height and width of the object?

Thanks!

+1  A: 

iframe is a block level element. It defaults to taking up the entire width of the parent container. So if you want to center it within it's parent container, you will need to set width, among other things, in the CSS.

Another approach would be to center the parent container.

Jason McCreary