Center Iframe Horizontally Without Specifying Width/Height CSS
I 开发者_开发百科have an iframe
which I'm trying to center using CSS, but is there a way to do it without specifying the height and width of the iframe
element?
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.
精彩评论