开发者

Center Iframe Horizontally Without Specifying Width/Height CSS

开发者 https://www.devze.com 2023-01-07 23:22 出处:网络
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 def

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

精彩评论

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