开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜