CSS adding border radius to an IFrame

前端 未结 11 915
南旧
南旧 2020-12-31 05:50

Adding a border to an IFrame is no biggie - you do it like this e.g.:

  border: 4px solid #000;
  -moz-border-radius: 15px;
  border-radius: 15px;
         


        
11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 06:28

    I know this is a rather old thread, but I found a valid work around for it that the others didn't cover.

    What you're seeing is a z-indexing issue. All you need to do is put your iFrame into a DIV, and set the DIV's and iframe's position to absolute. Then set your z-index in CSS. It works great with Youtube videos in bubbles!