Is it possible to have CSS rounded corners on an iframe?

后端 未结 5 816
傲寒
傲寒 2020-12-30 07:20

I\'ve looked around, and as far as I can see it\'s not possible, but say you\'re embedding a YouTube iframe, is it possible to round those corners using CSS?

5条回答
  •  情话喂你
    2020-12-30 08:01

    The div container method described in How to Get Rounded Corners on an iFrame using Border-Radius CSS works for me.

    And to do this you simply wrap the iFrame in div tags and give the div these css properties:

    The border-radius should be set to whatever you want the roundness to be, and the width must be set to the width of the iFrame, else you will get only a few (if any) rounded corners. But the most important thing is the overflow: hidden, as this hides the iFrames real corners.

提交回复
热议问题